【发布时间】:2012-01-10 09:47:05
【问题描述】:
你知道吗
int a<:10:>;
等价于
int a[10];
?
我正在编写一些代码,其中我有一个全局命名空间和一个受限命名空间,现在说 NS1。我的全局命名空间中有一个名为 Module 的类,我在 NS1 中导入了一些其他库,它们也有一个名为 Module 的类。我试图创建我的模块的 std::list,即 ::Module 在 NS1 的函数中,这样做,我得到了这个编译错误
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++
这个“<:>
【问题讨论】:
-
它们被称为有向图。还有像
??!是|这样的三元组。