Следующий код не компилируется с использованием clang 3.0, это потому, что я сделал это неправильно? Потому что он не разрешен в C++ 11 или потому, что он не поддерживается в clang?Варианты шаблона шаблона Variadic
template<int OFFSET>
struct A {
enum O { offset = OFFSET };
};
template < template <int T> class Head, typename... Tail>
struct C : public Head<1>, private C<Tail> { };
int main()
{
C< A, A > c1;
return 0;
}
Compiler ошибка:
test3.cxx:99:42: error: template argument for template template parameter must be a class template or type alias template
struct C : public Head<1>, private C<Tail> { };
^
test3.cxx:103:15: error: use of class template A requires template arguments
C< A, A > c1;
^
test3.cxx:94:12: note: template is declared here
struct A {
^
2 errors generated.
'Tail' - это пакет параметров шаблона, но вы никогда не расширяете пакет при создании экземпляра' C <> '- какого типа вы ожидаете от' C <> ', который будет создан? – ildjarn