Howard Hinnant | 94b2dd0 | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
Chandler Carruth | 57b08b0 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 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 |
Howard Hinnant | 94b2dd0 | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | // <chrono> |
| 10 | |
| 11 | // duration |
| 12 | |
| 13 | // Period shall be a specialization of ratio, diagnostic required. |
| 14 | |
| 15 | #include <chrono> |
| 16 | |
| 17 | template <int N, int D = 1> |
| 18 | class Ratio |
| 19 | { |
| 20 | public: |
| 21 | static const int num = N; |
| 22 | static const int den = D; |
| 23 | }; |
| 24 | |
JF Bastien | 2df59c5 | 2019-02-04 20:31:13 +0000 | [diff] [blame] | 25 | int main(int, char**) |
Howard Hinnant | 94b2dd0 | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 26 | { |
| 27 | typedef std::chrono::duration<int, Ratio<1> > D; |
| 28 | D d; |
JF Bastien | 2df59c5 | 2019-02-04 20:31:13 +0000 | [diff] [blame] | 29 | |
| 30 | return 0; |
Howard Hinnant | 94b2dd0 | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 31 | } |