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

source code of libcxx/test/std/containers/sequences/array/array.tuple/tuple_size.pass.cpp