Debian Codegraph @

libcxx/test/std/time/time.point/time.point.cast/toduration.compile.fail.cpp

raw
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // <chrono>
10
11 // time_point
12
13 // template <class ToDuration, class Clock, class Duration>
14 // time_point<Clock, ToDuration>
15 // time_point_cast(const time_point<Clock, Duration>& t);
16
17 // ToDuration shall be an instantiation of duration.
18
19 #include <chrono>
20
21 int main(int, char**)
22 {
23 typedef std::chrono::system_clock Clock;
24 typedef std::chrono::time_point<Clock, std::chrono::milliseconds> FromTimePoint;
25 typedef std::chrono::time_point<Clock, std::chrono::minutes> ToTimePoint;
26 std::chrono::time_point_cast<ToTimePoint>(FromTimePoint(std::chrono::milliseconds(3)));
27
28 return 0;
29 }