111
|
1 // Origin: PR c++/48320
|
|
2 // { dg-do compile { target c++11 } }
|
|
3
|
|
4 template<class... T>
|
|
5 struct tuple
|
|
6 {
|
|
7 typedef int type;
|
|
8 };
|
|
9
|
|
10 template<int... Indices>
|
|
11 struct indices
|
|
12 {
|
|
13 };
|
|
14
|
|
15 template<unsigned i, class Tuple>
|
|
16 struct tuple_element
|
|
17 {
|
|
18 typedef Tuple type;
|
|
19 };
|
|
20
|
|
21 template<class Tuple,
|
|
22 int... Indices,
|
|
23 class Result = tuple<typename tuple_element<Indices, Tuple>::type...> >
|
|
24 Result
|
|
25 f(Tuple&&, indices<Indices...>);
|
|
26
|
|
27
|
|
28 void
|
|
29 foo()
|
|
30 {
|
|
31 f(tuple<int, char, unsigned> (), indices<2, 1, 0> ());
|
|
32 }
|