operator==,!=,<,<=,>,>=(std::chrono::time_point)
提供: cppreference.com
<tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
<tbody class="t-dcl-rev t-dcl-rev-num ">
</tbody><tbody>
</tbody>
| (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 ); |
(C++11以上) (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 ); |
(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 ); |
(C++11以上) (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 ); |
(C++14以上) (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 ); |
(C++11以上) (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 ); |
(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 ); |
(C++11以上) (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 ); |
(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 ); |
(C++11以上) (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 ); |
(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 ); |
(C++11以上) (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 ); |
(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) | (C++20以上) |
2つの time point を比較します。 比較は time point の time_since_epoch() を比較することで行われます。
1-2)
lhs と rhs が指定されたクロックに対して同じ時点を参照しているか調べます。3-6)
lhs と rhs を比較します。7)
lhs と rhs を比較します。 戻り値の型は lhs.time_since_epoch() <=> rhs.time_since_epoch() から推定され、従って Dur1 と Dur2 との三方比較の結果の型です。引数
| lhs, rhs | - | 比較する time point |
戻り値
1)
lhs と rhs が同じ時点を参照していれば true、そうでなければ false。2)
lhs と rhs が異なる時点を参照していれば true、そうでなければ false。3)
lhs が rhs より前の時点を参照していれば true、そうでなければ false。4)
lhs が rhs より前または同じ時点を参照していれば true、そうでなければ false。5)
lhs が rhs より後の時点を参照していれば true、そうでなければ false。6)
lhs が rhs より後または同じ時点を参照していれば true、そうでなければ false。7)
lhs.time_since_epoch() <=> rhs.time_since_epoch()。例外
(なし)
ノート
これらの演算子は、 C++11 では constexpr ではありませんでしたが、 C++14 で修正されました。