“cpp/error/error code/operator cmp”的版本间的差异

来自cppreference.com
< cpp‎ | error‎ | error code
(P1614R2)
 
(未显示1个用户的1个中间版本)
第2行: 第2行:
 
{{cpp/error/error_code/navbar}}
 
{{cpp/error/error_code/navbar}}
 
{{dcl begin}}
 
{{dcl begin}}
{{dcl header | system_error}}
+
{{dcl header|system_error}}
{{dcl | num=1 | since=c++11 | 1=
+
{{dcl|num=1|since=c++11|1=
 
bool operator==( const std::error_code& lhs,
 
bool operator==( const std::error_code& lhs,
 
                 const std::error_code& rhs ) noexcept;
 
                 const std::error_code& rhs ) noexcept;
 
}}
 
}}
{{dcl | num=2 | since=c++11 | until=c++20 | 1=
+
{{dcl|num=2|since=c++11|until=c++20|1=
 
bool operator!=( const std::error_code& lhs,
 
bool operator!=( const std::error_code& lhs,
 
                 const std::error_code& rhs ) noexcept;
 
                 const std::error_code& rhs ) noexcept;
 
}}
 
}}
{{dcl | num=3 | since=c++11 | until=c++20 | 1=
+
{{dcl|num=3|since=c++11|until=c++20|1=
 
bool operator<( const std::error_code& lhs,
 
bool operator<( const std::error_code& lhs,
 
                 const std::error_code& rhs ) noexcept;
 
                 const std::error_code& rhs ) noexcept;
 
}}
 
}}
{{dcl | num=4 | since=c++20 | 1=
+
{{dcl|num=4|since=c++20|1=
 
std::strong_ordering operator<=>( const std::error_code& lhs,
 
std::strong_ordering operator<=>( const std::error_code& lhs,
 
                                   const std::error_code& rhs ) noexcept;
 
                                   const std::error_code& rhs ) noexcept;
第21行: 第21行:
 
{{dcl end}}
 
{{dcl end}}
  
 比较 error_code  对象。
+
 比较 个 对象。
  
@1@ 比较 {{tt|lhs}} 与 {{tt|rhs}} 的相等性。
+
@1@ 比较 {{|lhs}} 与 {{|rhs}} 的相等性。
@2@ 比较 {{tt|lhs}} 与 {{tt|rhs}} 的相等性。
+
@2@ 比较 {{|lhs}} 与 {{|rhs}} 的相等性。
@3@ 检查 {{tt|lhs}} 是否小于 {{tt|rhs}} 。  
+
@3@ 检查 {{|lhs}} 是否小于 {{|rhs}}。  
@4@ 获得 {{tt|lhs}} 与 {{tt|rhs}} 的三路比较结果。
+
@4@ 获得 {{|lhs}} 与 {{|rhs}} 的三路比较结果。
 +
 
 +
 +
 +
  
 
===参数===
 
===参数===
 
{{par begin}}
 
{{par begin}}
{{par | lhs, rhs | 要比较的 error_code }}
+
{{par | lhs, rhs | 要比较的 }}
 
{{par end}}
 
{{par end}}
  
 
===返回值===
 
===返回值===
@1@ 若错误类别和错误值比较相等则为 {{c|true}}
+
@1@ 若错误类别和错误值比较相等则为 {{c|true}}。
@2@ 若错误类别或错误值比较不相等则为 {{c|true}}
+
@2@ 若错误类别或错误值比较不相等则为 {{c|true}}。
@3@ 若 {{c|lhs.category() < rhs.category()}} 则为 {{c|true}} 。否则,若 {{c|1=lhs.category() == rhs.category() && lhs.value() < rhs.value()}} 则为 {{c|true}} 。否则为 {{c|false}}
+
@3@ 若 {{c|lhs.category() < rhs.category()}} 则为 {{c|true}}。否则,若 {{c|1=lhs.category() == rhs.category() && lhs.value() < rhs.value()}} 则为 {{c|true}}。否则为 {{c|false}}
@4@ 若 {{c|1=lhs.category() <=> rhs.category()}} 不为 {{c|std::strong_ordering::equal}} 则为该值。否则为 {{c|1=lhs.value() <=> rhs.value()}}
+
@4@ 若 {{c|1=lhs.category() <=> rhs.category()}} 不为 {{c|std::strong_ordering::equal}} 则为该值。否则为 {{c|1=lhs.value() <=> rhs.value()}}。
  
 
===参阅===
 
===参阅===
 
{{dsc begin}}
 
{{dsc begin}}
{{dsc inc | cpp/error/error_code/dsc category}}
+
{{dsc inc|cpp/error/error_code/dsc category
 +
 +
}}
 
{{dsc end}}
 
{{dsc end}}
  
 
{{langlinks|de|en|es|fr|it|ja|pt|ru}}
 
{{langlinks|de|en|es|fr|it|ja|pt|ru}}

2023年12月1日 (五) 20:51的最后版本