function
<system_error>

std::relational operators (error_condition)

vs error_condition(1)
bool operator== (const error_condition& lhs, const error_condition& rhs) noexcept;
bool operator!= (const error_condition& lhs, const error_condition& rhs) noexcept;
bool operator<  (const error_condition& lhs, const error_condition& rhs) noexcept;
vs error_code(2)
bool operator== (const error_condition& lhs, const error_code& rhs) noexcept;
bool operator== (const error_code& lhs, const error_condition& rhs) noexcept;
bool operator!= (const error_condition& lhs, const error_code& rhs) noexcept;
bool operator!= (const error_code& lhs, const error_condition& rhs) noexcept;
Relational operators
Returns the result of the relational operation between lhs and rhs.

When the comparison involves two objects of type error_condition:
  • if they are of the same category, the function returns the result of applying the appropriate operator (==, !=, <) on their associated values.
  • otherwise, the function returns the result of applying the operator (==, !=, <) to their categories.

If the operation involves an error_condition object and an error_code object, the function calls to error_category::equivalent to determine whether they are equivalent.

These functions behave as if defined as:
1
2
3
4
5
6
7
8
9
10
11
12
13
bool operator== (const error_condition& lhs, const error_condition& rhs) noexcept
{ return lhs.category()==rhs.category() && lhs.value()==rhs.value(); }
bool operator!= (const error_condition& lhs, const error_condition& rhs) noexcept
{ return !(lhs==rhs); }
bool operator<  (const error_condition& lhs, const error_condition& rhs) noexcept
{ return lhs.category()<rhs.category() || lhs.category()==rhs.category()&&lhs.value()<rhs.value(); }

bool operator== (const error_condition& lhs, const error_code& rhs) noexcept
{ return lhs.category().equivalent(lhs.value,rhs) || rhs.category().equivalent(lhs,rhs.value()); }
bool operator== (const error_code& lhs, const error_condition& rhs) noexcept
{ return lhs.category().equivalent(lhs.value,rhs) || rhs.category().equivalent(lhs,rhs.value()); }
bool operator!= (const error_condition& lhs, const error_code& rhs) noexcept { return !(lhs==rhs); }
bool operator!= (const error_code& lhs, const error_condition& rhs) noexcept { return !(lhs==rhs); }


Parameters

lhs, rhs
Objects (to the left- and right-hand side of the operator, respectively).

Return value

true if the condition holds, and false otherwise.

See also