Home | History | Annotate | Download | only in time.point.cast
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <chrono>
     11 
     12 // time_point
     13 
     14 // template <class ToDuration, class Clock, class Duration>
     15 //   time_point<Clock, ToDuration>
     16 //   time_point_cast(const time_point<Clock, Duration>& t);
     17 
     18 // ToDuration shall be an instantiation of duration.
     19 
     20 #include <chrono>
     21 
     22 int main()
     23 {
     24     typedef std::chrono::system_clock Clock;
     25     typedef std::chrono::time_point<Clock, std::chrono::milliseconds> FromTimePoint;
     26     typedef std::chrono::time_point<Clock, std::chrono::minutes> ToTimePoint;
     27     std::chrono::time_point_cast<ToTimePoint>(FromTimePoint(std::chrono::milliseconds(3)));
     28 }
     29