##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# operator==,!=,<(std::error_condition)

From cppreference.com
< cpp‎ | error‎ | error condition

Defined in header `<system_error>` |  |
bool operator==( const error_condition& lhs, const error_condition& rhs ); | (1) | (since C++11)
bool operator==( const error_code& lhs, const error_condition& rhs ); | (2) | (since C++11)
bool operator==( const error_condition& lhs, const error_code& rhs ); | (2) | (since C++11)
bool operator!=( const error_condition& lhs, const error_condition& rhs ); | (3) | (since C++11)
bool operator!=( const error_code& lhs, const error_condition& rhs ); | (4) | (since C++11)
bool operator!=( const error_condition& lhs, const error_code& rhs ); | (4) | (since C++11)
bool operator<( const error_condition& lhs, const error_condition& rhs ); | (5) | (since C++11)

Compares two error conditions.

1-2) Checks whether `lhs` and `rhs` are equal.
3-4) Checks whether `lhs` and `rhs` are not equal.
5) Checks whether `lhs` is less than `rhs`.

### [edit] Parameters

lhs, rhs | - | error conditions to compare

### [edit] Return value

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

### [edit] Exceptions

`noexcept` specification:
noexcept
Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/error/error_condition/operator_cmp&oldid=91470"
Category:

- unconditionally noexcept

Hidden categories:

- Pages with unreviewed unconditional noexcept template
- Pages with unreviewed noexcept template