Defined in header <system_error> | ||
---|---|---|
bool operator==( const std::error_code& lhs, const std::error_code& rhs ) noexcept; | (1) | (since C++11) |
bool operator!=( const std::error_code& lhs, const std::error_code& rhs ) noexcept; | (2) | (since C++11) (until C++20) |
bool operator<( const std::error_code& lhs, const std::error_code& rhs ) noexcept; | (3) | (since C++11) (until C++20) |
std::strong_ordering operator<=>( const std::error_code& lhs, const std::error_code& rhs ) noexcept; | (4) | (since C++20) |
Compares two error code objects.
lhs
and rhs
for equality.lhs
and rhs
for equality.lhs
is less than rhs
. lhs
and rhs
. The | (since C++20) |
lhs, rhs | - | error codes to compare |
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()
. obtains the error_category for this error_code (public member function) |
|
obtains the value of the error_code (public member function) |
|
(removed in C++20)(removed in C++20)(C++20) | compares error_condition s and error_code s (function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/error/error_code/operator_cmp