29 Time library [time]

29.7 Clocks [time.clock]

29.7.10 time_point conversions [time.clock.cast]

29.7.10.6 Function template clock_cast [time.clock.cast.fn]

template<class DestClock, class SourceClock, class Duration> auto clock_cast(const time_point<SourceClock, Duration>& t);
Constraints: At least one of the following clock time conversion expressions is well-formed:
  • clock_time_conversion<DestClock, SourceClock>{}(t)
  • clock_time_conversion<DestClock, system_clock>{}( clock_time_conversion<system_clock, SourceClock>{}(t))
  • clock_time_conversion<DestClock, utc_clock>{}( clock_time_conversion<utc_clock, SourceClock>{}(t))
  • clock_time_conversion<DestClock, utc_clock>{}( clock_time_conversion<utc_clock, system_clock>{}( clock_time_conversion<system_clock, SourceClock>{}(t)))
  • clock_time_conversion<DestClock, system_clock>{}( clock_time_conversion<system_clock, utc_clock>{}( clock_time_conversion<utc_clock, SourceClock>{}(t)))
A clock time conversion expression is considered better than another clock time conversion expression if it involves fewer operator() calls on clock_time_conversion specializations.
Mandates: Among the well-formed clock time conversion expressions from the above list, there is a unique best expression.
Returns: The best well-formed clock time conversion expression in the above list.