似乎铛++(我试过铛3.2)模板把模板类的名字作为实例化的类,而不是为类范围内的任何occurence的模板。例如,以下代码铛++ - 治疗模板类的名称作为类范围
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;
}
我应该怎样编译它?
@neuront:哇...从来不知道'<:'...+1到雅都 – Cornstalks
@Cornstalks,如果您有兴趣,对于那些以前没有[钥匙]的人来说,这是一个二合字母。 – chris
@neuront'<::'现在是词法分析器的特例,但它是C++ 11中的一项新功能。 – Potatoswatter