|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
(C++20)(C++20) | ||||
| Non-member functions | ||||
operator==operator!=operator<operator<=operator>operator>=operator<=> (until C++20)(C++20) | ||||
(C++17) | ||||
(C++17) | ||||
(C++17) | ||||
| Helper classes | ||||
Defined in header <chrono> | ||
| (1) | ||
template<class Clock,class Dur1,class Dur2> bool operator==(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++11) (until C++14) | |
template<class Clock,class Dur1,class Dur2> constexprbool operator==(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++14) | |
| (2) | ||
template<class Clock,class Dur1,class Dur2> bool operator!=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++11) (until C++14) | |
template<class Clock,class Dur1,class Dur2> constexprbool operator!=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++14) (until C++20) | |
| (3) | ||
template<class Clock,class Dur1,class Dur2> bool operator<(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++11) (until C++14) | |
template<class Clock,class Dur1,class Dur2> constexprbool operator<(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++14) | |
| (4) | ||
template<class Clock,class Dur1,class Dur2> bool operator<=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++11) (until C++14) | |
template<class Clock,class Dur1,class Dur2> constexprbool operator<=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++14) | |
| (5) | ||
template<class Clock,class Dur1,class Dur2> bool operator>(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++11) (until C++14) | |
template<class Clock,class Dur1,class Dur2> constexprbool operator>(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++14) | |
| (6) | ||
template<class Clock,class Dur1,class Dur2> bool operator>=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++11) (until C++14) | |
template<class Clock,class Dur1,class Dur2> constexprbool operator>=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (since C++14) | |
template<class Clock,class Dur1,std::three_way_comparable_with<Dur1> Dur2> constexprauto operator<=>(conststd::chrono::time_point<Clock,Dur1>& lhs, | (7) | (since C++20) |
Compares two time points. The comparison is done by comparing the resultstime_since_epoch() for the time points.
Dur1 andDur2.The | (since C++20) |
Contents |
| lhs, rhs | - | time points to compare |
May throw implementation-defined exceptions.
Two-way comparison operators oftime_point were notconstexpr in C++11, this was corrected in C++14.