seconds.pass.cpp 908 B

123456789101112131415161718192021222324252627282930
  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. // <chrono>
  9. // typedef duration<signed integral type of at least 35 bits > seconds;
  10. #include <chrono>
  11. #include <type_traits>
  12. #include <limits>
  13. #include "test_macros.h"
  14. int main(int, char**)
  15. {
  16. typedef std::chrono::seconds D;
  17. typedef D::rep Rep;
  18. typedef D::period Period;
  19. static_assert(std::is_signed<Rep>::value, "");
  20. static_assert(std::is_integral<Rep>::value, "");
  21. static_assert(std::numeric_limits<Rep>::digits >= 34, "");
  22. static_assert((std::is_same<Period, std::ratio<1> >::value), "");
  23. return 0;
  24. }