名前空間
変種
操作

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

提供: cppreference.com
< cpp‎ | chrono‎ | time point
 
 
ユーティリティライブラリ
汎用ユーティリティ
日付と時間
関数オブジェクト
書式化ライブラリ(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 スタイルの日付と時間
 
std::chrono::time_point
メンバ関数
非メンバ関数
operator==operator!=operator<operator<=operator>operator>=operator<=>
(C++20未満)(C++20)
(C++17)
(C++17)
(C++17)
ヘルパークラス
 
(1)
template<class Clock, class Dur1, class Dur2 >

bool operator==(conststd::chrono::time_point<Clock,Dur1>& lhs,

                 conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++11以上)
(C++14未満)
template<class Clock, class Dur1, class Dur2 >

constexprbool operator==(conststd::chrono::time_point<Clock,Dur1>& lhs,

                           conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++14以上)
(2)
template<class Clock, class Dur1, class Dur2 >

bool operator!=(conststd::chrono::time_point<Clock,Dur1>& lhs,

                 conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++11以上)
(C++14未満)
template<class Clock, class Dur1, class Dur2 >

constexprbool operator!=(conststd::chrono::time_point<Clock,Dur1>& lhs,

                           conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++14以上)
(C++20未満)
(3)
template<class Clock, class Dur1, class Dur2 >

bool operator<(conststd::chrono::time_point<Clock,Dur1>& lhs,

                conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++11以上)
(C++14未満)
template<class Clock, class Dur1, class Dur2 >

constexprbool operator<(conststd::chrono::time_point<Clock,Dur1>& lhs,

                          conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++14以上)
(4)
template<class Clock, class Dur1, class Dur2 >

bool operator<=(conststd::chrono::time_point<Clock,Dur1>& lhs,

                 conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++11以上)
(C++14未満)
template<class Clock, class Dur1, class Dur2 >

constexprbool operator<=(conststd::chrono::time_point<Clock,Dur1>& lhs,

                           conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++14以上)
(5)
template<class Clock, class Dur1, class Dur2 >

bool operator>(conststd::chrono::time_point<Clock,Dur1>& lhs,

                conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++11以上)
(C++14未満)
template<class Clock, class Dur1, class Dur2 >

constexprbool operator>(conststd::chrono::time_point<Clock,Dur1>& lhs,

                          conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++14以上)
(6)
template<class Clock, class Dur1, class Dur2 >

bool operator>=(conststd::chrono::time_point<Clock,Dur1>& lhs,

                 conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++11以上)
(C++14未満)
template<class Clock, class Dur1, class Dur2 >

constexprbool operator>=(conststd::chrono::time_point<Clock,Dur1>& lhs,

                           conststd::chrono::time_point<Clock,Dur2>& rhs );
(C++14以上)
template<class Clock, class Dur1, std::three_way_comparable_with<Dur1> Dur2>

constexprauto operator<=>(conststd::chrono::time_point<Clock,Dur1>& lhs,

                            conststd::chrono::time_point<Clock,Dur2>& rhs );
(7) (C++20以上)

2つの time point を比較します。 比較は time point の time_since_epoch() を比較することで行われます。

1-2)lhsrhs が指定されたクロックに対して同じ時点を参照しているか調べます。
3-6)lhsrhs を比較します。
7)lhsrhs を比較します。 戻り値の型は lhs.time_since_epoch()<=> rhs.time_since_epoch() から推定され、従って Dur1Dur2 との三方比較の結果の型です。

目次

[編集]引数

lhs, rhs - 比較する time point

[編集]戻り値

1)lhsrhs が同じ時点を参照していれば true、そうでなければ false
2)lhsrhs が異なる時点を参照していれば true、そうでなければ false
3)lhsrhs よりの時点を参照していれば true、そうでなければ false
4)lhsrhs よりまたは同じ時点を参照していれば true、そうでなければ false
5)lhsrhs よりの時点を参照していれば true、そうでなければ false
6)lhsrhs よりまたは同じ時点を参照していれば true、そうでなければ false
7)lhs.time_since_epoch()<=> rhs.time_since_epoch()

[編集]例外

(なし)

[編集]ノート

これらの演算子は、 C++11 では constexpr ではありませんでしたが、 C++14 で修正されました。

close