<system_error> operators

Visual Studio 2015
 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at <system_error> operators.

operator!=](#operator_neq)|operator<|operator==|

Tests if the object on the left side of the operator is equal to the object on the right side.

bool operator==(const error_code& left,
    const error_condition& right);

bool operator==(const error_condition& left,
    const error_code& right);

Parameters

ParameterDescription
leftThe object to be tested for equality.
rightThe object to be tested for equality.

Return Value

true if the objects are equal; false if objects are not equal.

Remarks

This function returns left.category() == right.category() && left.value() == right.value().

Tests if the object on the left side of the operator is not equal to the object on the right side.

bool operator!=(const error_code& left,
    const error_condition& right);

bool operator!=(const error_condition& left,
    const error_code& right);

Parameters

ParameterDescription
leftThe object to be tested for inequality.
rightThe object to be tested for inequality.

Return Value

true if the object passed in left is not equal to the object passed in right; otherwise false.

Remarks

This function returns !(left == right).

Tests if an object is less than the object passed in for comparison.

template <class _Enum>  
inline bool operator<(
    _Enum left,
    typename enable_if<is_error_code_enum<_Enum>::value,
    const error_code&>::type right);

template <class _Enum>  
inline bool operator<(
    typename enable_if<is_error_code_enum<_Enum>::value,
    const error_code&>::type left, _Enum right);

template <class _Enum>  
inline bool operator<(
    _Enum left,
    typename enable_if<is_error_condition_enum<_Enum>::value,
    const error_condition&>::type right);

template <class _Enum>  
inline bool operator<(
    typename enable_if<is_error_condition_enum<_Enum>::value,
    const error_condition&>::type left, _Enum right);

Parameters

ParameterDescription
leftThe object to be compared.
rightThe object to be compared.

Return Value

true if the object passed in left is less than the object passed in right; Otherwise, false.

Remarks

This function tests the error order.

<system_error>

Show: