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

定义于头文件 <system_error>
bool operator==( const error_condition& lhs, const error_condition& rhs ) noexcept;
(1) (C++11 起)
bool operator==( const error_code& lhs, const error_condition& rhs ) noexcept;
(2) (C++11 起)
bool operator==( const error_condition& lhs, const error_code& rhs ) noexcept;
(2) (C++11 起)
bool operator!=( const error_condition& lhs, const error_condition& rhs ) noexcept;
(3) (C++11 起)
bool operator!=( const error_code& lhs, const error_condition& rhs ) noexcept;
(4) (C++11 起)
bool operator!=( const error_condition& lhs, const error_code& rhs ) noexcept;
(4) (C++11 起)
bool operator<( const error_condition& lhs, const error_condition& rhs ) noexcept;
(5) (C++11 起)

比较二个 error_condition 。

1-2) 检查 lhsrhs 是否相等。
3-4) 检查 lhsrhs 是否不相等。
5) 检查 lhs 是否小于 rhs

参数

lhs, rhs - 要比较的 error_conditions

返回值

1) 若错误类别与错误值比较相等则为 true
2)lhs.category().equivalent(lhs.value(), rhs)rhs.category().equivalent(lhs, rhs.value()) 则为 true
3) 若错误类别或错误值比较相等则为 true
4)lhs.category().equivalent(lhs.value(), rhs)rhs.category().equivalent(lhs, rhs.value()) 均为 false 则为 true
5)lhs.category() < rhs.category() 则为 true 。否则,若 lhs.category() == rhs.category() && lhs.value() < rhs.value() 则为 true 。否则为 false

版本历史

  • (当前 | 先前) 2017年6月8日 (四) 07:53Fruderica讨论 | 贡献. . (1,913字节) (+1,913). . (以“{{title | 1=operator==,!=,<{{small|(std::error_condition)}}}} {{cpp/error/error_condition/navbar}} {{dcl begin}} {{dcl header | system_error}} {{dcl | num=1 | since=...”为内容创建页面)