Вопрос

The following code cannot be compiled with VC++ 2013 CTP.

template <template <class> A, class B>
void f(A<B>)
{}

The output are as follows:

error C2988: unrecognizable template declaration/definition
error C2059: syntax error : '<L_TEMPLATEDECL>'
error C2065: 'A' : undeclared identifier
error C2065: 'B' : undeclared identifier
error C2988: unrecognizable template declaration/definition
error C2059: syntax error : ')'
Это было полезно?

Решение

Do you mean this?

template <template <class> class A, class B>
void f(A<B>)
{}

Другие советы

For what it worths, clang says:

error: template template parameter requires 'class' after the parameter list
template <template <class> A, class B>
                           ^
                           class 
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top