Compare two duration objects to see if one is less than the other, even if they have distinct representations and/or periods.
template <class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator<( const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
Either lhs
must
be implicitly convertible to rhs
,
or vice versa. If neither can be implicitly converted to the other,
or they are distinct instantiations of duration but each can implicitly
convert to the other, then the expression is ill formed.
If CommonDuration is a synonym for std::common_type<
duration<
Rep1,
Period1>,
duration<
Rep2,
Period2>>::type
, then lhs<rhs
returns CommonDuration(lhs).count()<CommonDuration(rhs).count()
.
#include <chrono>