名前空間
変種

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

提供: cppreference.com
 
 
ユーティリティライブラリ
汎用ユーティリティ
日付と時間
関数オブジェクト
書式化ライブラリ (C++20)
(C++11)
関係演算子 (C++20で非推奨)
整数比較関数
(C++20)
スワップと型操作
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
一般的な語彙の型
(C++11)
(C++17)
(C++17)
(C++17)
(C++17)

初等文字列変換
(C++17)
(C++17)
 
日付と時間のユーティリティ
(C++11)
(C++11)
時刻
(C++20)



(C++20)(C++20)(C++20)(C++20)
時計
(C++20)
                                             
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
カレンダー
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
タイムゾーン
(C++20)
(C++20)
(C++20)
(C++20)
C スタイルの日付と時間
 
 
<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 で修正されました。