<分区>
Possible Duplicate:
<: cannot begin a template argument list
你知道吗
int a<:10:>;
相当于
int a[10];
?
我正在编写一些代码,其中我有一个全局命名空间和一个受限命名空间,现在假设为 NS1。我的全局命名空间中有一个名为 Module 的类,我在 NS1 中导入了一些其他库,它们也有一个名为 Module 的类。我试图创建我的模块的 std::list,即 NS1 中的函数内的::Module 并这样做,我得到了这个编译错误
std::list<::Module*> &myModule;
genllvm.cpp:60:11: error: ‘<::’ cannot begin a template-argument list
./genllvm.cpp:60:11: note: ‘<:’ is an alternate spelling for ‘[’. Insert whitespace between ‘<’ and ‘::’
./genllvm.cpp:60:11: note: (if you use ‘-fpermissive’ G++
这个“<:”语法的意义是什么?