> );
std::list c{ {1}, {2}, {-3} };
static_assert( std::three_way_comparable
);
static_assert( std::same_as c), std::partial_ordering> );
VERIFY( (c <=> c) == std::partial_ordering::unordered );
}
void
test04()
{
struct L
{
int value = 0;
bool operator<(L rhs) const noexcept { return value < rhs.value; }
};
static_assert( std::totally_ordered> );
std::list c{ {1}, {2}, {3} }, d{ {1}, {2}, {3}, {4} };
static_assert( std::same_as c), std::weak_ordering> );
VERIFY( std::is_lt(c <=> d) );
}
static_assert( ! std::totally_ordered::iterator> );
static_assert( ! std::three_way_comparable::iterator> );
int
main()
{
test01();
test02();
test03();
test04();
}