
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.60 KB | hits: 11 | expires: Never
Nested template specialization depending on enclosing template parameters
template < int ...Indices>
class T1 {
template <int _1, int _2>
class T2;
};
template <int ...Indices>
template <int _1>
class T1<Indices...>::T2<_1, sizeof...(Indices)> {};
//^--error: non-type template argument depends on a template parameter of the partial specialization
template < int ...Indices>
class T1
{
static const int index_size = sizeof...(Indices);
template <int _1, int _2>
class T2;
};
template <int ...Indices>
template <int _1>
class T1<Indices...>::T2<_1, T1<Indices...>::index_size> {};