Marshall Clow | 5b08c17 | 2018-10-16 17:27:54 +0000 | [diff] [blame] | 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 | //===----------------------------------------------------------------------===// |
Mikhail Maltsev | b7e43df | 2018-10-24 15:09:08 +0000 | [diff] [blame] | 9 | // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 |
Marshall Clow | 5b08c17 | 2018-10-16 17:27:54 +0000 | [diff] [blame] | 10 | |
| 11 | // <chrono> |
| 12 | |
| 13 | // using weeks = duration<signed integer type of at least 22 bits, ratio_multiply<ratio<7>, days::period>>; |
| 14 | |
| 15 | #include <chrono> |
| 16 | #include <type_traits> |
| 17 | #include <limits> |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | typedef std::chrono::weeks D; |
| 22 | typedef D::rep Rep; |
| 23 | typedef D::period Period; |
| 24 | static_assert(std::is_signed<Rep>::value, ""); |
| 25 | static_assert(std::is_integral<Rep>::value, ""); |
| 26 | static_assert(std::numeric_limits<Rep>::digits >= 22, ""); |
| 27 | static_assert(std::is_same_v<Period, std::ratio_multiply<std::ratio<7>, std::chrono::days::period>>, ""); |
| 28 | } |