]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/variadic12.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / variadic12.C
CommitLineData
4b2e63de 1// { dg-do compile { target c++11 } }
d6a85c8d
DG
2// A tuple type
3template<typename... Args> struct tuple { };
4
5// Determine if two types are the same
6template<typename T, typename U>
7struct is_same {
8 static const bool value = false;
9};
10
11template<typename T>
12struct is_same<T, T> {
13 static const bool value = true;
14};
15
16// Append 'T' to the end of Tuple
17template<typename T, typename Tuple>
18struct append_to_tuple;
19
20template<typename T, typename... Args>
21struct append_to_tuple<T, tuple<Args...> > {
22 typedef tuple<Args..., T> type;
23};
24
25// Reverse a sequence of arguments (and return the result as a tuple)
26template<typename... Args> struct reverse;
27
28template<typename T, typename... Args>
29struct reverse<T, Args...> {
30 typedef typename append_to_tuple<T, typename reverse<Args...>::type>::type
31 type;
32};
33
34template<>
35struct reverse<> {
36 typedef tuple<> type;
37};
38
39int a0[is_same<reverse<>::type, tuple<> >::value? 1 : -1];
40int a1[is_same<reverse<int>::type, tuple<int> >::value? 1 : -1];
41int a2[is_same<reverse<char, int>::type, tuple<int, char> >::value? 1 : -1];
42int a3[is_same<reverse<char, int, long>::type, tuple<long, int, char> >::value? 1 : -1];
This page took 7.468452 seconds and 5 git commands to generate.