1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
13 // explicit time_point(const duration& d);
18 #include "test_macros.h"
22 typedef std::chrono::system_clock Clock
;
23 typedef std::chrono::milliseconds Duration
;
25 std::chrono::time_point
<Clock
, Duration
> t(Duration(3));
26 assert(t
.time_since_epoch() == Duration(3));
29 std::chrono::time_point
<Clock
, Duration
> t(std::chrono::seconds(3));
30 assert(t
.time_since_epoch() == Duration(3000));
34 constexpr std::chrono::time_point
<Clock
, Duration
> t(Duration(3));
35 static_assert(t
.time_since_epoch() == Duration(3), "");
38 constexpr std::chrono::time_point
<Clock
, Duration
> t(std::chrono::seconds(3));
39 static_assert(t
.time_since_epoch() == Duration(3000), "");