std::operator==,!=,<(std::error_code)

From cppreference.com
< cpp‎ | error‎ | error code
 
 
Utilities library
Type support (basic types, RTTI, type traits)
Dynamic memory management
Error handling
Program utilities
Variadic functions
Date and time
Function objects
(C++11)
Relational operators
Optional and any
(C++17)
(C++17)
Pairs and tuples
(C++11)
(C++17)
Swap, forward and move
(C++14)
(C++11)
(C++11)
Type operations
(C++11)
(C++17)
 
 
 
Defined in header <system_error>
bool operator==( const error_code& lhs, const error_code& rhs );
(1) (since C++11)
bool operator!=( const error_code& lhs, const error_code& rhs );
(1) (since C++11)
bool operator<( const error_code& lhs, const error_code& rhs );
(1) (since C++11)

Compares two error code objects.

1) Compares lhs and rhs for equality.
2) Compares lhs and rhs for equality.
3) Checks whether lhs is less than rhs.

Contents

[edit] Parameters

lhs, rhs - error codes to compare

[edit] Return value

1) true if the error category and error value compare equal.
2) true if the error category or error value compare are not equal.
3) true if lhs.category() < rhs.category(). Otherwise, true if lhs.category() == rhs.category() && lhs.value() < rhs.value(). Otherwise, false

[edit] Exceptions

noexcept specification:  
noexcept
  

[edit] See also

obtains the error_category for this error_code
(public member function)