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 | |
9 | // <array> |
10 | |
11 | // tuple_size<array<T, N> >::value |
12 | |
13 | #include <array> |
14 | |
15 | #include "test_macros.h" |
16 | |
17 | template <class T, std::size_t N> |
18 | void test() |
19 | { |
20 | { |
21 | typedef std::array<T, N> C; |
22 | static_assert((std::tuple_size<C>::value == N), "" ); |
23 | } |
24 | { |
25 | typedef std::array<T const, N> C; |
26 | static_assert((std::tuple_size<C>::value == N), "" ); |
27 | } |
28 | { |
29 | typedef std::array<T volatile, N> C; |
30 | static_assert((std::tuple_size<C>::value == N), "" ); |
31 | } |
32 | { |
33 | typedef std::array<T const volatile, N> C; |
34 | static_assert((std::tuple_size<C>::value == N), "" ); |
35 | } |
36 | } |
37 | |
38 | int main(int, char**) |
39 | { |
40 | test<double, 0>(); |
41 | test<double, 3>(); |
42 | test<double, 5>(); |
43 | |
44 | return 0; |
45 | } |
46 | |