operator==,!=,<,<=,>,>=(std::time_point) (3) - Linux Manuals

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

NAME

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

Synopsis


template< class Clock, class Dur1, class Dur2 > (since C++11)
bool operator==( const time_point<Clock,Dur1>& lhs, (until C++14)
const time_point<Clock,Dur2>& rhs );
template< class Clock, class Dur1, class Dur2 >
constexpr bool operator==( const time_point<Clock,Dur1>& lhs, (since C++14)
const time_point<Clock,Dur2>& rhs );
template< class Clock, class Dur1, class Dur2 > (since C++11)
bool operator!=( const time_point<Clock,Dur1>& lhs, (until C++14)
const time_point<Clock,Dur2>& rhs );
template< class Clock, class Dur1, class Dur2 >
constexpr bool operator!=( const time_point<Clock,Dur1>& lhs, (since C++14)
const time_point<Clock,Dur2>& rhs );
template< class Clock, class Dur1, class Dur2 > (since C++11)
bool operator<( const time_point<Clock,Dur1>& lhs, (until C++14)
const time_point<Clock,Dur2>& rhs );
template< class Clock, class Dur1, class Dur2 >
constexpr bool operator<( const time_point<Clock,Dur1>& lhs, (since C++14)
const time_point<Clock,Dur2>& rhs ); (1)
template< class Clock, class Dur1, class Dur2 > (since C++11)
bool operator<=( const time_point<Clock,Dur1>& lhs, (until C++14)
const time_point<Clock,Dur2>& rhs ); (2)
template< class Clock, class Dur1, class Dur2 >
constexpr bool operator<=( const time_point<Clock,Dur1>& lhs, (since C++14)
const time_point<Clock,Dur2>& rhs ); (3)
template< class Clock, class Dur1, class Dur2 > (since C++11)
bool operator>( const time_point<Clock,Dur1>& lhs, (until C++14)
const time_point<Clock,Dur2>& rhs ); (4)
template< class Clock, class Dur1, class Dur2 >
constexpr bool operator>( const time_point<Clock,Dur1>& lhs, (since C++14)
const time_point<Clock,Dur2>& rhs ); (5)
template< class Clock, class Dur1, class Dur2 > (since C++11)
bool operator>=( const time_point<Clock,Dur1>& lhs, (until C++14)
const time_point<Clock,Dur2>& rhs ); (6)
template< class Clock, class Dur1, class Dur2 >
constexpr bool operator>=( const time_point<Clock,Dur1>& lhs, (since C++14)
const time_point<Clock,Dur2>& rhs );


Compares two time points. The comparison is done by comparing the results time_since_epoch() for the time points.
1-2) Checks if the time points lhs and rhs refer to the same time point for the given clock.
3-6) Compares the time points lhs and rhs.

Parameters


lhs, rhs - time points to compare

Return value


1) true if the lhs and rhs refer to the same time point, false otherwise.
2) true if the lhs and rhs refer to different time points, false otherwise.
3) true if the lhs refers to time point before rhs, false otherwise.
4) true if the lhs refers to time point before rhs, or to the same time point as rhs, false otherwise.
5) true if the lhs refers to time point after rhs, false otherwise.
6) true if the lhs refers to time point after rhs, or to the same time point as rhs, false otherwise.

Exceptions


(none)

Notes


These operators were not constexpr in C++11, this was corrected in C++14.