Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/support/test_comparisons.h
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
static_assert((std::is_convertible<decltype(std::declval<const T&>() == std::declval<const U&>()), bool>::value), ""); | static_assert((std::is_convertible<decltype(std::declval<const T&>() == std::declval<const U&>()), bool>::value), ""); | ||||
static_assert((std::is_convertible<decltype(std::declval<const T&>() != std::declval<const U&>()), bool>::value), ""); | static_assert((std::is_convertible<decltype(std::declval<const T&>() != std::declval<const U&>()), bool>::value), ""); | ||||
} | } | ||||
struct LessAndEqComp { | struct LessAndEqComp { | ||||
int value; | int value; | ||||
LessAndEqComp(int v) : value(v) {} | TEST_CONSTEXPR_CXX14 LessAndEqComp(int v) : value(v) {} | ||||
friend bool operator<(const LessAndEqComp& lhs, const LessAndEqComp& rhs) { | friend TEST_CONSTEXPR_CXX14 bool operator<(const LessAndEqComp& lhs, const LessAndEqComp& rhs) { | ||||
return lhs.value < rhs.value; | return lhs.value < rhs.value; | ||||
} | } | ||||
friend bool operator==(const LessAndEqComp& lhs, const LessAndEqComp& rhs) { | friend TEST_CONSTEXPR_CXX14 bool operator==(const LessAndEqComp& lhs, const LessAndEqComp& rhs) { | ||||
return lhs.value == rhs.value; | return lhs.value == rhs.value; | ||||
} | } | ||||
}; | }; | ||||
#endif // TEST_COMPARISONS_H | #endif // TEST_COMPARISONS_H |