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 // static constexpr duration zero(); // noexcept after C++17
18 #include "test_macros.h"
19 #include "../../rep.h"
24 LIBCPP_ASSERT_NOEXCEPT(std::chrono::duration_values
<typename
D::rep
>::zero());
26 ASSERT_NOEXCEPT( std::chrono::duration_values
<typename
D::rep
>::zero());
29 typedef typename
D::rep DRep
;
30 DRep zero_rep
= std::chrono::duration_values
<DRep
>::zero();
31 assert(D::zero().count() == zero_rep
);
33 #if TEST_STD_VER >= 11
35 typedef typename
D::rep DRep
;
36 constexpr DRep zero_rep
= std::chrono::duration_values
<DRep
>::zero();
37 static_assert(D::zero().count() == zero_rep
, "");
44 test
<std::chrono::duration
<int> >();
45 test
<std::chrono::duration
<Rep
> >();