operator==,!=,<,<=,>,>=,<=>(std::chrono::time_point)
定义在头文件 <chrono> 中 |
||
(1) | ||
template< class Clock, class Dur1, class Dur2 > bool operator==( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 C++11 起) (直到 C++14) |
|
template< class Clock, class Dur1, class Dur2 > constexpr bool operator==( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 C++14 起) | |
(2) | ||
template< class Clock, class Dur1, class Dur2 > bool operator!=( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 C++11 起) (直到 C++14) |
|
template< class Clock, class Dur1, class Dur2 > constexpr bool operator!=( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 C++14 起) (直到 C++20) |
|
(3) | ||
template< class Clock, class Dur1, class Dur2 > bool operator<( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 C++11 起) (直到 C++14) |
|
template< class Clock, class Dur1, class Dur2 > constexpr bool operator<( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 C++14 起) | |
(4) | ||
template< class Clock, class Dur1, class Dur2 > bool operator<=( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 C++11 起) (直到 C++14) |
|
template< class Clock, class Dur1, class Dur2 > constexpr bool operator<=( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 C++14 起) | |
(5) | ||
template< class Clock, class Dur1, class Dur2 > bool operator>( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 C++11 起) (直到 C++14) |
|
template< class Clock, class Dur1, class Dur2 > constexpr bool operator>( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 C++14 起) | |
(6) | ||
template< class Clock, class Dur1, class Dur2 > bool operator>=( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 C++11 起) (直到 C++14) |
|
template< class Clock, class Dur1, class Dur2 > constexpr bool operator>=( const std::chrono::time_point<Clock,Dur1>& lhs, |
(自 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, |
(7) | (自 C++20 起) |
比较两个时间点。比较是通过比较时间点的 time_since_epoch() 结果来完成的。
Dur1
和 Dur2
的三路比较结果类型。
|
(自 C++20 起) |
目录 |
[编辑] 参数
lhs, rhs | - | 要比较的时间点 |
[编辑] 返回值
[编辑] 异常
可能会抛出实现定义的异常。
[编辑] 备注
在 C++11 中,time_point
的双向比较运算符不是 constexpr,这个问题在 C++14 中得到了修复。