std::error_...erator==,!=,(3)
π std::error_...erator==,!=,(3) π
okay so real talk, bestie: this page is from the <cyan>C++ Standard Libary</cyan> manual β yes, spelled exactly like that in the manual name, βLibaryβ and all, Iβm not fixing it β and itβs the whole group-chat saga of comparing std::error_category objects. π
πΈ NAME πΈ
std::error_category::operator==,!=, β std::error_category::operator==,!=,
(yes, the description is literally the same truncated string, iconic behavior, no notes π)
β¨ Synopsis β¨
the overload lineup, with all the version labels kept exactly as they are:
- (1) (since C++11) β
bool operator==( const error_category& rhs ) const noexcept; - (2) (since C++11) (until C++20) β
bool operator!=( const error_category& rhs ) const noexcept; - (3) (since C++11) (until C++20) β
bool operator<( const error_category& rhs ) const noexcept; - (4) (since C++20) β
std::strong_ordering operator<=>( const error_category& rhs ) const noexcept;
Compares to another error category. thatβs the whole main character job. hereβs the breakdown:
- Checks whether
*thisandrhsrefer to the same object. π - Checks whether
*thisandrhsdo not refer to the same object. π - Orders
*thisandrhsby the order ofthisand&rhs. Equivalent tostd::less<const error_category*>()(this, &rhs). π₯ - Orders
*thisandrhsby the order ofthisand&rhs. Equivalent tostd::compare_three_way()(this, &rhs). β
and the synthesized-operator tea: the <, <=, >, >=, and != operators are synthesized from operator<=> (since C++20) and operator== respectively. periodt. π
π Parameters π
rhsβ specifies theerror_categoryto compare. π
π Return value π
trueif*thisandrhsrefer to the same object,falseotherwise.trueif*thisandrhsdo not refer to the same object,falseotherwise.trueif*thisis less thanrhsas defined by the order ofthisand&rhs.std::strong_order::lessif*thisis less thanrhsas defined by the order ofthisand&rhs, otherwisestd::strong_order::greaterifrhsis less than*thisin the order, otherwisestd::strong_order::equal.
xoxo, your Unix bestie π
β source/version: http://cppreference.com, 2024.06.10, page: std::error_...erator==,!=,(3). π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms