Namespaces
Variants

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

From cppreference.net
Utilities library
(Anmerkung: Der bereitgestellte HTML-Code enthält keinen übersetzbaren Text, da alle Tags und Attribute gemäß den Anweisungen unverändert bleiben sollen und die Tabellenzellen leer sind.)
Definiert in Header <system_error>
bool operator == ( const std:: error_condition & lhs,
const std:: error_condition & rhs ) noexcept ;
(1) (seit C++11)
bool operator ! = ( const std:: error_condition & lhs,
const std:: error_condition & rhs ) noexcept ;
(2) (seit C++11)
(bis C++20)
bool operator < ( const std:: error_condition & lhs,
const std:: error_condition & rhs ) noexcept ;
(3) (seit C++11)
(bis C++20)
std:: strong_ordering operator <=> ( const std:: error_condition & lhs,
const std:: error_condition & rhs ) noexcept ;
(4) (seit C++20)
bool operator == ( const std:: error_code & code,
const std:: error_condition & cond ) noexcept ;
(5) (seit C++11)
bool operator == ( const std:: error_condition & cond,
const std:: error_code & code ) noexcept ;
(5) (seit C++11)
(bis C++20)
bool operator ! = ( const std:: error_code & code,
const std:: error_condition & cond ) noexcept ;
(6) (seit C++11)
(bis C++20)
bool operator ! = ( const std:: error_condition & cond,
const std:: error_code & code ) noexcept ;
(6) (seit C++11)
(bis C++20)

Vergleicht zwei Fehlerzustände.

1) Prüft, ob lhs und rhs gleich sind.
2) Prüft, ob lhs und rhs ungleich sind.
3) Überprüft, ob lhs kleiner als rhs ist.
4) Ermittelt das Drei-Wege-Vergleichsergebnis von lhs und rhs .
5) Prüft, ob code eine semantische Übereinstimmung für cond ist.
6) Überprüft, ob code keine semantische Übereinstimmung mit cond aufweist.

Die Operatoren < , <= , > , >= und != werden synthetisiert aus operator <=> bzw. operator == .

(seit C++20)

Parameter

lhs, rhs, cond - zu vergleichende Fehlerbedingungen
code - der zu vergleichende Fehlercode

Rückgabewert

1) true wenn die Fehlerkategorie und der Fehlerwert gleich sind.
2) true falls die Fehlerkategorie oder der Fehlerwertvergleich nicht gleich sind.
3) true wenn lhs. category ( ) < rhs. category ( ) . Andernfalls true wenn lhs. category ( ) == rhs. category ( ) && lhs. value ( ) < rhs. value ( ) . Andernfalls false .
4) lhs. category ( ) <=> rhs. category ( ) falls es nicht std :: strong_ordering :: equal ist. Andernfalls, lhs. value ( ) <=> rhs. value ( ) .
5) true wenn entweder code. category ( ) . equivalent ( code. value ( ) , cond ) oder cond. category ( ) . equivalent ( code, cond. value ( ) ) .
6) true wenn weder code. category ( ) . equivalent ( code. value ( ) , cond ) noch cond. category ( ) . equivalent ( code, cond. value ( ) ) .

Siehe auch

[virtual]
vergleicht error_code und error_condition auf Äquivalenz
(virtuelle öffentliche Mitgliedsfunktion von std::error_category )
(entfernt in C++20) (entfernt in C++20) (C++20)
vergleicht zwei error_code s
(Funktion)