문제

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