在线文档教程
C++
应用 | Utilities

operators (std::time_point)

运算符=,%21=,<,<=,>,>=%28 std::time[医]点%29

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

比较两个时间点。通过比较结果进行了比较。time_since_epoch()时间点。

1-2%29检查时间点lhsrhs请参考给定时钟的相同时间点。

3-6%29比较时间点lhsrhs...

参数

lhs, rhs-time points to compare

返回值

1%29true如果lhsrhs参考同一时间点,false否则。

2%29true如果lhsrhs参考不同的时间点,false否则。

3%29true如果lhs指时间点以前rhs,,,false否则。

4%29true如果lhs指时间点以前rhs,或者在同一时间点rhs,,,false否则。

5%29true如果lhs指时间点rhs,,,false否则。

6%29true如果lhs指时间点rhs,或者在同一时间点rhs,,,false否则。

例外

%280%29

注记

这些经营者不是constexpr在C++11中,这一点在C++14中得到了纠正。

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/crono/time[医]点/算子[医]CMP