1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
11 // tuple_element<I, array<T, N> >::type
14 #include <type_traits>
16 #include "test_macros.h"
23 typedef std::array
<T
, 3> C
;
24 static_assert((std::is_same
<typename
std::tuple_element
<0, C
>::type
, Exp
>::value
), "");
25 static_assert((std::is_same
<typename
std::tuple_element
<1, C
>::type
, Exp
>::value
), "");
26 static_assert((std::is_same
<typename
std::tuple_element
<2, C
>::type
, Exp
>::value
), "");
30 typedef std::array
<T
, 3> const C
;
31 static_assert((std::is_same
<typename
std::tuple_element
<0, C
>::type
, Exp
>::value
), "");
32 static_assert((std::is_same
<typename
std::tuple_element
<1, C
>::type
, Exp
>::value
), "");
33 static_assert((std::is_same
<typename
std::tuple_element
<2, C
>::type
, Exp
>::value
), "");
36 typedef T
volatile Exp
;
37 typedef std::array
<T
, 3> volatile C
;
38 static_assert((std::is_same
<typename
std::tuple_element
<0, C
>::type
, Exp
>::value
), "");
39 static_assert((std::is_same
<typename
std::tuple_element
<1, C
>::type
, Exp
>::value
), "");
40 static_assert((std::is_same
<typename
std::tuple_element
<2, C
>::type
, Exp
>::value
), "");
43 typedef T
const volatile Exp
;
44 typedef std::array
<T
, 3> const volatile C
;
45 static_assert((std::is_same
<typename
std::tuple_element
<0, C
>::type
, Exp
>::value
), "");
46 static_assert((std::is_same
<typename
std::tuple_element
<1, C
>::type
, Exp
>::value
), "");
47 static_assert((std::is_same
<typename
std::tuple_element
<2, C
>::type
, Exp
>::value
), "");