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

2.0 KiB
Raw Permalink Blame History

[time.clock.conv]

30 Time library [time]

30.7 Clocks [time.clock]

30.7.10 time_point conversions [time.clock.cast]

30.7.10.1 Class template clock_time_conversion [time.clock.conv]

namespace std::chrono {template<class DestClock, class SourceClock>struct clock_time_conversion {};}

1

#

clock_time_conversion serves as a trait which can be used to specify how to convert a source time_point of typetime_point<SourceClock, Duration> to a destination time_point of typetime_point<DestClock, Duration> via a specialization:clock_time_conversion<DestClock, SourceClock>.

A specialization of clock_time_conversion<DestClock, SourceClock> shall provide a const-qualified operator() that takes a parameter of type time_point<SourceClock, Duration> and returns a time_point<DestClock, OtherDuration> representing an equivalent point in time.

OtherDuration is a chrono::duration whose specialization is computed from the input Duration in a manner which can vary for each clock_time_conversion specialization.

A program may specialize clock_time_conversion if at least one of the template parameters is a user-defined clock type.

2

#

Several specializations are provided by the implementation, as described in[time.clock.cast.id],[time.clock.cast.sys.utc],[time.clock.cast.sys], and[time.clock.cast.utc].