Home | History | Annotate | Download | only in time.traits.duration_values
      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_values::max
     13 
     14 #include <chrono>
     15 #include <limits>
     16 #include <cassert>
     17 
     18 #include "test_macros.h"
     19 #include "../../rep.h"
     20 
     21 int main()
     22 {
     23     assert(std::chrono::duration_values<int>::max() ==
     24            std::numeric_limits<int>::max());
     25     assert(std::chrono::duration_values<double>::max() ==
     26            std::numeric_limits<double>::max());
     27     assert(std::chrono::duration_values<Rep>::max() ==
     28            std::numeric_limits<Rep>::max());
     29 #if TEST_STD_VER >= 11
     30     static_assert(std::chrono::duration_values<int>::max() ==
     31            std::numeric_limits<int>::max(), "");
     32     static_assert(std::chrono::duration_values<double>::max() ==
     33            std::numeric_limits<double>::max(), "");
     34     static_assert(std::chrono::duration_values<Rep>::max() ==
     35            std::numeric_limits<Rep>::max(), "");
     36 #endif
     37 }
     38