Files
2025-10-25 03:02:53 +03:00

3.0 KiB
Raw Permalink Blame History

[time.duration.comparisons]

30 Time library [time]

30.5 Class template duration [time.duration]

30.5.7 Comparisons [time.duration.comparisons]

1

#

In the function descriptions that follow, CT representscommon_type_t<A, B>, where A and B are the types of the two arguments to the function.

🔗

template<class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);

2

#

Returns: CT(lhs).count() == CT(rhs).count().

🔗

template<class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator<(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);

3

#

Returns: CT(lhs).count() < CT(rhs).count().

🔗

template<class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator>(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);

4

#

Returns: rhs < lhs.

🔗

template<class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);

5

#

Returns: !(rhs < lhs).

🔗

template<class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);

6

#

Returns: !(lhs < rhs).

🔗

template<class Rep1, class Period1, class Rep2, class Period2> requires [three_way_comparable](cmp.concept#concept:three_way_comparable "17.12.4Concept three_­way_­comparable[cmp.concept]")<typename CT::rep> constexpr auto operator<=>(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);

7

#

Returns: CT(lhs).count() <=> CT(rhs).count().