【发布时间】:2010-03-19 11:13:57
【问题描述】:
除了微软即将推出的 VC10 之外?
【问题讨论】:
除了微软即将推出的 VC10 之外?
【问题讨论】:
here 很好地细分了几个主要编译器对 c++0x 的支持
【讨论】:
您可以运行 g++ -std=c++0x 以获得大部分兼容的 C++0x 实现。
来自手册:
c++0x 即将发布的 ISO C++0x 标准的工作草案。此选项启用实验性功能,这些功能是 可能包含在 C++0x 中。工作草案不断变化,任何启用的功能 如果此标志不是 C++0x 标准的一部分,则可能会从 GCC 的未来版本中删除。作为一个愚蠢的小例子:
$ cat a.cpp
const int FOO_VERSION = 2;
int main() {
static_assert(FOO_VERSION >= 3, "Your version of Foo doesn't contain the necessary bugfixes to run this program correctly.");
return 0;
}
$ g++ -std=c++0x a.cpp
a.cpp:1:17: error: stdio: No such file or directory
a.cpp: In function ‘int main()’:
a.cpp:6: error: static assertion failed: "Your version of Foo doesn\'t contain the necessary bugfixes to run this program correctly."
另外,正如@GMan 在评论中提到的,GCC's list of C++0x compatibility 可以在网上找到。
【讨论】: