toduration.fail.cpp revision b64f8b07c104c6cc986570ac8ee0ed16a9f23976
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
22int 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