Question

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 : ')'
Was it helpful?

Solution

Do you mean this?

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

OTHER TIPS

For what it worths, clang says:

error: template template parameter requires 'class' after the parameter list
template <template <class> A, class B>
                           ^
                           class 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top