看起来clang++(我尝试了clang 3.2)将模板类名称视为已实例化的类,而不是在类作用域内的任何出现的模板。例如,以下代码:
template <template <class> class T>
class A {};
template <typename T>
class B {
A<B> member;
// ^---- clang++ treats B as an instantiated class
// but I want it to be a template here
// this code could compile in g++
};
int main()
{
B<int> b;
return 0;
}
我该怎么做才能编译它?
<:
...给你们两个加1分 - Cornstalks<::
是词法分析器的一个特例,但它是C++11中的新功能。 - Potatoswatter