Documentation Home

Compare two duration objects for equality, 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);

Requirements:

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.

Effects:

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().

Header

#include <chrono>

See Also