• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // duration
13 
14 // template <class Rep1, class Period, class Rep2>
15 //   constexpr
16 //   duration<typename common_type<Rep1, Rep2>::type, Period>
17 //   operator%(const duration<Rep1, Period>& d, const Rep2& s)
18 
19 #include <chrono>
20 #include <cassert>
21 
22 #include "test_macros.h"
23 
main()24 int main()
25 {
26     {
27     std::chrono::nanoseconds ns(15);
28     ns = ns % 6;
29     assert(ns.count() == 3);
30     }
31 #if TEST_STD_VER >= 11
32     {
33     constexpr std::chrono::nanoseconds ns(15);
34     constexpr std::chrono::nanoseconds ns2 = ns % 6;
35     static_assert(ns2.count() == 3, "");
36     }
37 #endif
38 }
39