| 1 |
template <typename T0> struct tuple { |
| 2 |
typedef tuple<int> tail; |
| 3 |
}; |
| 4 |
|
| 5 |
template <> struct tuple<int> { |
| 6 |
}; |
| 7 |
|
| 8 |
template <typename L> |
| 9 |
struct length { |
| 10 |
static const int i = length<typename tuple<L>::tail>::i; |
| 11 |
}; |
| 12 |
|
| 13 |
template<> |
| 14 |
struct length<tuple<int> > { |
| 15 |
static const int i = 1; |
| 16 |
}; |
| 17 |
|
| 18 |
template <int> struct M {}; |
| 19 |
|
| 20 |
template <typename A> |
| 21 |
M<length<tuple<A> >::i > foo (A*); |
| 22 |
|
| 23 |
template <typename A> |
| 24 |
M<length<tuple<A> >::i> foo (const A*); |
| 25 |
|
| 26 |
const int i1 = 3; |
| 27 |
|
| 28 |
void bar() { |
| 29 |
foo (&i1); |
| 30 |
} |