operator==,!=,<,<=,>,>=(std::chrono::time_point)
(1) | ||
template<class Clock, class Dur1, class Dur2 > bool operator==(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++11以上) (C++14未満) | |
template<class Clock, class Dur1, class Dur2 > constexprbool operator==(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++14以上) | |
(2) | ||
template<class Clock, class Dur1, class Dur2 > bool operator!=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++11以上) (C++14未満) | |
template<class Clock, class Dur1, class Dur2 > constexprbool operator!=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++14以上) (C++20未満) | |
(3) | ||
template<class Clock, class Dur1, class Dur2 > bool operator<(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++11以上) (C++14未満) | |
template<class Clock, class Dur1, class Dur2 > constexprbool operator<(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++14以上) | |
(4) | ||
template<class Clock, class Dur1, class Dur2 > bool operator<=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++11以上) (C++14未満) | |
template<class Clock, class Dur1, class Dur2 > constexprbool operator<=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++14以上) | |
(5) | ||
template<class Clock, class Dur1, class Dur2 > bool operator>(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++11以上) (C++14未満) | |
template<class Clock, class Dur1, class Dur2 > constexprbool operator>(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++14以上) | |
(6) | ||
template<class Clock, class Dur1, class Dur2 > bool operator>=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++11以上) (C++14未満) | |
template<class Clock, class Dur1, class Dur2 > constexprbool operator>=(conststd::chrono::time_point<Clock,Dur1>& lhs, | (C++14以上) | |
template<class Clock, class Dur1, std::three_way_comparable_with<Dur1> Dur2> constexprauto operator<=>(conststd::chrono::time_point<Clock,Dur1>& lhs, | (7) | (C++20以上) |
2つの time point を比較します。 比較は time point の time_since_epoch() を比較することで行われます。
lhs
と rhs
が指定されたクロックに対して同じ時点を参照しているか調べます。lhs
と rhs
を比較します。lhs
と rhs
を比較します。 戻り値の型は lhs.time_since_epoch()<=> rhs.time_since_epoch() から推定され、従って Dur1
と Dur2
との三方比較の結果の型です。目次 |
[編集]引数
lhs, rhs | - | 比較する time point |
[編集]戻り値
lhs
と rhs
が同じ時点を参照していれば true、そうでなければ false。lhs
と rhs
が異なる時点を参照していれば true、そうでなければ false。lhs
が rhs
より前の時点を参照していれば true、そうでなければ false。lhs
が rhs
より前または同じ時点を参照していれば true、そうでなければ false。lhs
が rhs
より後の時点を参照していれば true、そうでなければ false。lhs
が rhs
より後または同じ時点を参照していれば true、そうでなければ false。[編集]例外
(なし)
[編集]ノート
これらの演算子は、 C++11 では constexpr
ではありませんでしたが、 C++14 で修正されました。