1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <array> 11 12 // tuple_element<I, array<T, N> >::type 13 14 #include <array> 15 #include <type_traits> 16 17 int main() 18 { 19 { 20 typedef double T; 21 typedef std::array<T, 3> C; 22 static_assert((std::is_same<std::tuple_element<0, C>::type, T>::value), ""); 23 static_assert((std::is_same<std::tuple_element<1, C>::type, T>::value), ""); 24 static_assert((std::is_same<std::tuple_element<2, C>::type, T>::value), ""); 25 } 26 { 27 typedef int T; 28 typedef std::array<T, 3> C; 29 static_assert((std::is_same<std::tuple_element<0, C>::type, T>::value), ""); 30 static_assert((std::is_same<std::tuple_element<1, C>::type, T>::value), ""); 31 static_assert((std::is_same<std::tuple_element<2, C>::type, T>::value), ""); 32 } 33 } 34