1 // { dg-do compile { target c++11 } }
3 template<typename... Args> struct tuple { };
5 // Determine if two types are the same
6 template<typename T, typename U>
8 static const bool value = false;
12 struct is_same<T, T> {
13 static const bool value = true;
16 // Append 'T' to the end of Tuple
17 template<typename T, typename Tuple>
18 struct append_to_tuple;
20 template<typename T, typename... Args>
21 struct append_to_tuple<T, tuple<Args...> > {
22 typedef tuple<Args..., T> type;
25 // Reverse a sequence of arguments (and return the result as a tuple)
26 template<typename... Args> struct reverse;
28 template<typename T, typename... Args>
29 struct reverse<T, Args...> {
30 typedef typename append_to_tuple<T, typename reverse<Args...>::type>::type
39 int a0[is_same<reverse<>::type, tuple<> >::value? 1 : -1];
40 int a1[is_same<reverse<int>::type, tuple<int> >::value? 1 : -1];
41 int a2[is_same<reverse<char, int>::type, tuple<int, char> >::value? 1 : -1];
42 int a3[is_same<reverse<char, int, long>::type, tuple<long, int, char> >::value? 1 : -1];