Namespaces
Variants
Views
Actions

std::chrono::time_point_cast

From cppreference.com
< cpp‎ | chrono‎ | time point
Revision as of 14:43, 2 November 2012 by P12bot (Talk | contribs)

template <class ToDuration, class Clock, class Duration>
time_point<Clock, ToDuration> time_point_cast(const time_point<Clock, Duration> &t);
(since C++11)

Converts a std::chrono::time_point from one duration to another.

Contents

Parameters

t - time_point to convert from

Return value

std::chrono::time_point<Clock, ToDuration>(std::chrono::duration_cast<ToDuration>(t.time_since_epoch()))

Notes

time_point_cast will only participate in overload resolution if ToDuration is an instantiation of duration.

Example