|
18 | 18 |
|
19 | 19 | #include "test_macros.h" |
20 | 20 |
|
21 | | -int main(int, char**) |
22 | | -{ |
23 | | - using empty = std::integer_sequence<int>; |
24 | | - using size4 = std::integer_sequence<int, 9, 8, 7, 2>; |
25 | | - |
26 | | - static_assert ( std::tuple_size_v<empty> == 0, "empty size wrong" ); |
27 | | - static_assert ( std::tuple_size_v<const empty> == 0, "empty size wrong" ); |
28 | | - |
29 | | - static_assert ( std::tuple_size_v<size4> == 4, "size4 size wrong" ); |
30 | | - static_assert ( std::tuple_size_v<const size4> == 4, "size4 size wrong" ); |
31 | | - |
32 | | - static_assert ( std::is_same_v<std::tuple_element_t<0, size4>, int>, "size4 type wrong" ); |
33 | | - static_assert ( std::is_same_v<std::tuple_element_t<1, size4>, int>, "size4 type wrong" ); |
34 | | - static_assert ( std::is_same_v<std::tuple_element_t<2, size4>, int>, "size4 type wrong" ); |
35 | | - static_assert ( std::is_same_v<std::tuple_element_t<3, size4>, int>, "size4 type wrong" ); |
36 | | - |
37 | | - static_assert ( std::is_same_v<std::tuple_element_t<0, const size4>, int>, "const4 type wrong" ); |
38 | | - static_assert ( std::is_same_v<std::tuple_element_t<1, const size4>, int>, "const4 type wrong" ); |
39 | | - static_assert ( std::is_same_v<std::tuple_element_t<2, const size4>, int>, "const4 type wrong" ); |
40 | | - static_assert ( std::is_same_v<std::tuple_element_t<3, const size4>, int>, "const4 type wrong" ); |
41 | | - |
42 | | - constexpr static size4 seq4{}; |
43 | | - static_assert ( get<0> (seq4) == 9, "size4 element 0 wrong" ); |
44 | | - static_assert ( get<1> (seq4) == 8, "size4 element 1 wrong" ); |
45 | | - static_assert ( get<2> (seq4) == 7, "size4 element 2 wrong" ); |
46 | | - static_assert ( get<3> (seq4) == 2, "size4 element 3 wrong" ); |
| 21 | +int main(int, char**) { |
| 22 | + using empty = std::integer_sequence<int>; |
| 23 | + using size4 = std::integer_sequence<int, 9, 8, 7, 2>; |
| 24 | + |
| 25 | + static_assert(std::tuple_size_v<empty> == 0, "empty size wrong"); |
| 26 | + static_assert(std::tuple_size_v<const empty> == 0, "empty size wrong"); |
| 27 | + |
| 28 | + static_assert(std::tuple_size_v<size4> == 4, "size4 size wrong"); |
| 29 | + static_assert(std::tuple_size_v<const size4> == 4, "size4 size wrong"); |
| 30 | + |
| 31 | + static_assert(std::is_same_v<std::tuple_element_t<0, size4>, int>, "size4 type wrong"); |
| 32 | + static_assert(std::is_same_v<std::tuple_element_t<1, size4>, int>, "size4 type wrong"); |
| 33 | + static_assert(std::is_same_v<std::tuple_element_t<2, size4>, int>, "size4 type wrong"); |
| 34 | + static_assert(std::is_same_v<std::tuple_element_t<3, size4>, int>, "size4 type wrong"); |
| 35 | + |
| 36 | + static_assert(std::is_same_v<std::tuple_element_t<0, const size4>, int>, "const4 type wrong"); |
| 37 | + static_assert(std::is_same_v<std::tuple_element_t<1, const size4>, int>, "const4 type wrong"); |
| 38 | + static_assert(std::is_same_v<std::tuple_element_t<2, const size4>, int>, "const4 type wrong"); |
| 39 | + static_assert(std::is_same_v<std::tuple_element_t<3, const size4>, int>, "const4 type wrong"); |
| 40 | + |
| 41 | + constexpr static size4 seq4{}; |
| 42 | + static_assert(get<0>(seq4) == 9, "size4 element 0 wrong"); |
| 43 | + static_assert(get<1>(seq4) == 8, "size4 element 1 wrong"); |
| 44 | + static_assert(get<2>(seq4) == 7, "size4 element 2 wrong"); |
| 45 | + static_assert(get<3>(seq4) == 2, "size4 element 3 wrong"); |
47 | 46 |
|
48 | 47 | return 0; |
49 | 48 | } |
0 commit comments