سؤال

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