Defined in header <compare> | ||
---|---|---|
constexpr bool is_eq(std::weak_equality cmp) noexcept; | (1) | (since C++20) |
constexpr bool is_neq(std::weak_equality cmp) noexcept; | (2) | (since C++20) |
constexpr bool is_lt(std::partial_ordering cmp) noexcept; | (3) | (since C++20) |
constexpr bool is_lteq(std::partial_ordering cmp) noexcept; | (4) | (since C++20) |
constexpr bool is_gt(std::partial_ordering cmp) noexcept; | (5) | (since C++20) |
constexpr bool is_gteq(std::partial_ordering cmp) noexcept | (6) | (since C++20) |
These functions take a result of 3-way comparison and convert it to the result of one of the six relational operators.
Specifically, these functions return.
cmp == 0
cmp != 0
cmp < 0
cmp <= 0
cmp > 0
cmp >= 0
cmp | - | result of 3-way comparison |
bool
result of the corresponding relational operation.
(C++20) | the result type of 3-way comparison that supports all 6 operators, is not substitutable, and allows incomparable values (class) |
(C++20) | the result type of 3-way comparison that supports only equality/inequality and is not substitutable (class) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/utility/compare/named_comparison_functions