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
在gcc 4.5+上编译但在clang 3.1和icc上都没有编译,都抱怨sizeof...(Indices)
的使用。 它只是一个尚未实现的功能在后面的编译器或一些特殊情况?取决于封闭模板参数的嵌套模板专门化
感谢,
Buote
看起来像这些编译器中的错误。如果可以的话,尝试在'T1'' class {}'块内定义嵌套模板,如果需要的话,可能委托给一个单独的成员模板。 – Potatoswatter 2012-01-15 12:20:49