Defined in header <chrono> | ||
---|---|---|
template< class Dest, class Source, class Duration > auto clock_cast( const std::chrono::time_point<Source, Duration>& t ); | (since C++20) |
Converts the time point t
of a clock Source
to an equivalent time point of the clock Dest
, using std::chrono::system_clock
and/or std::chrono::utc_clock
as intermediaries if necessary.
std::chrono::clock_time_conversion<Dest, Source>{}(t)
is well-formed, returns the result of that expression. std::chrono::clock_time_conversion<Dest, std::chrono::system_clock>{}(
std::chrono::clock_time_conversion<std::chrono::system_clock, Source>{}(t))
std::chrono::clock_time_conversion<Dest, std::chrono::utc_clock>{}(
std::chrono::clock_time_conversion<std::chrono::utc_clock, Source>{}(t))
std::chrono::clock_time_conversion<Dest, std::chrono::utc_clock>{}(
std::chrono::clock_time_conversion<std::chrono::utc_clock, std::chrono::system_clock>{}(
std::chrono::clock_time_conversion.
<std::chrono::system_clock, Source>{}(t)))
std::chrono::clock_time_conversion<Dest, std::chrono::system_clock>{}(
std::chrono::clock_time_conversion<std::chrono::system_clock, std::chrono::utc_clock>{}(
std::chrono::clock_time_conversion.
<std::chrono::utc_clock, Source>{}(t)))
The result of the conversion, determined as described above.
(C++20) | traits class defining how to convert time points of one clock to another (class template) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/chrono/clock_cast