operator==,!=,<,<=>(std::error_condition) - cppreference.com (original) (raw)
Defined in header <system_error> | ||
---|---|---|
bool operator==( const std::error_condition& lhs, const std::error_condition& rhs ) noexcept; | (1) | (since C++11) |
bool operator!=( const std::error_condition& lhs, const std::error_condition& rhs ) noexcept; | (2) | (since C++11) (until C++20) |
bool operator<( const std::error_condition& lhs, const std::error_condition& rhs ) noexcept; | (3) | (since C++11) (until C++20) |
std::strong_ordering operator<=>( const std::error_condition& lhs, const std::error_condition& rhs ) noexcept; | (4) | (since C++20) |
bool operator==( const std::error_code& code, const std::error_condition& cond ) noexcept; | (5) | (since C++11) |
bool operator==( const std::error_condition& cond, const std::error_code& code ) noexcept; | (5) | (since C++11) (until C++20) |
bool operator!=( const std::error_code& code, const std::error_condition& cond ) noexcept; | (6) | (since C++11) (until C++20) |
bool operator!=( const std::error_condition& cond, const std::error_code& code ) noexcept; | (6) | (since C++11) (until C++20) |
Compares two error conditions.
Checks whether lhs and rhs are equal.
Checks whether lhs and rhs are not equal.
Checks whether lhs is less than rhs.
Obtains three-way comparison result of lhs and rhs.
Checks whether code is a semantic match for cond.
Checks whether code is not a semantic match for cond.
The <, <=, >, >=, and != operators are synthesized from operator<=> and operator== respectively. | (since C++20) |
---|
[edit] Parameters
lhs, rhs, cond | - | error conditions to compare |
---|---|---|
code | - | the error code to compare |
[edit] Return value
true if the error category and error value compare equal.
true if the error category or error value compare are not equal.
true if lhs.category() < rhs.category(). Otherwise, true if lhs.category() == rhs.category() && lhs.value() < rhs.value(). Otherwise, false.
lhs.category() <=> rhs.category() if it is not std::strong_ordering::equal. Otherwise, lhs.value() <=> rhs.value().
true if either code.category().equivalent(code.value(), cond) or cond.category().equivalent(code, cond.value()).
true if neither code.category().equivalent(code.value(), cond) nor cond.category().equivalent(code, cond.value()).