Namespaces
Variants

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

Von de.cppreference.net
 
 
Dienstprogrammbibliothek
Sprachunterstützung
Typunterstützung (Basistypen, RTTI)
Bibliotheks-Feature-Test-Makros (C++20)
Programmdienstprogramme
Variadische Funktionen
Koroutinenunterstützung (C++20)
Vertragsunterstützung (C++26)
Drei-Wege-Vergleich
(C++20)
(C++20)(C++20)(C++20)    
(C++20)(C++20)(C++20)

Allgemeine Dienstprogramme
Relationale Operatoren (veraltet in C++20)
 
 
 
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 nicht gleich sind.
3) Prüft, ob lhs kleiner als rhs
4) Ermittelt das Drei-Wege-Vergleichsergebnis von lhs und rhs.
5) Prüft, ob code eine semantische Übereinstimmung mit cond ist.
6) Prüft, ob code keine semantische Übereinstimmung mit cond ist.

Die Operatoren <, <=, >, >=, und != werden aus 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)