Namespaces
Variants

operator==,!=,<,<=,>,>=,<=> (std::chrono::time_point)

From cppreference.net
Definiert im Header <chrono>
(1)
template < class Clock, class Dur1, class Dur2 >

bool operator == ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++11)
(bis C++14)
template < class Clock, class Dur1, class Dur2 >

constexpr bool operator == ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++14)
(2)
template < class Clock, class Dur1, class Dur2 >

bool operator ! = ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++11)
(bis C++14)
template < class Clock, class Dur1, class Dur2 >

constexpr bool operator ! = ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++14)
(bis C++20)
(3)
template < class Clock, class Dur1, class Dur2 >

bool operator < ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++11)
(bis C++14)
template < class Clock, class Dur1, class Dur2 >

constexpr bool operator < ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++14)
(4)
template < class Clock, class Dur1, class Dur2 >

bool operator <= ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++11)
(bis C++14)
template < class Clock, class Dur1, class Dur2 >

constexpr bool operator <= ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++14)
(5)
template < class Clock, class Dur1, class Dur2 >

bool operator > ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++11)
(bis C++14)
template < class Clock, class Dur1, class Dur2 >

constexpr bool operator > ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++14)
(6)
template < class Clock, class Dur1, class Dur2 >

bool operator >= ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++11)
(bis C++14)
template < class Clock, class Dur1, class Dur2 >

constexpr bool operator >= ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(seit C++14)
template < class Clock, class Dur1, std:: three_way_comparable_with < Dur1 > Dur2 >

constexpr auto operator <=> ( const std:: chrono :: time_point < Clock,Dur1 > & lhs,

const std:: chrono :: time_point < Clock,Dur2 > & rhs ) ;
(7) (seit C++20)

Vergleicht zwei Zeitpunkte. Der Vergleich erfolgt durch Vergleich der Ergebnisse von time_since_epoch() für die Zeitpunkte.

1,2) Prüft, ob die Zeitpunkte lhs und rhs denselben Zeitpunkt für die gegebene Uhr referenzieren.
3-6) Vergleicht die Zeitpunkte lhs und rhs .
7) Vergleicht die Zeitpunkte lhs und rhs . Der Rückgabetyp wird von lhs. time_since_epoch ( ) <=> rhs. time_since_epoch ( ) abgeleitet, und somit vom Drei-Wege-Vergleichsergebnistyp von Dur1 und Dur2 .

Der != -Operator wird synthetisiert aus operator== .

(seit C++20)

Inhaltsverzeichnis

Parameter

lhs, rhs - zu vergleichende Zeitpunkte

Rückgabewert

1) true wenn lhs und rhs auf denselben Zeitpunkt verweisen, false andernfalls.
2) true wenn lhs und rhs auf verschiedene Zeitpunkte verweisen, false andernfalls.
3) true wenn lhs auf einen Zeitpunkt vor rhs verweist, false andernfalls.
4) true wenn lhs auf einen Zeitpunkt vor rhs oder auf denselben Zeitpunkt wie rhs verweist, false andernfalls.
5) true wenn lhs auf einen Zeitpunkt nach rhs verweist, false andernfalls.
6) true falls lhs auf einen Zeitpunkt nach rhs oder auf denselben Zeitpunkt wie rhs verweist, false andernfalls.
7) lhs. time_since_epoch ( ) <=> rhs. time_since_epoch ( ) .

Exceptions

Kann implementierungsdefinierte Ausnahmen auslösen.

Hinweise

Die bidirektionalen Vergleichsoperatoren von time_point waren in C++11 nicht constexpr , dies wurde in C++14 korrigiert.