Other than Microsoft's upcoming VC10?
+5
A:
You can run g++ -std=c++0x
for mostly-compatible C++0x implementation.
From the manual:
c++0x The working draft of the upcoming ISO C++0x standard. This option enables experimental features that are likely to be included in C++0x. The working draft is constantly changing, and any feature that is enabled by this flag may be removed from future versions of GCC if it is not part of the C++0x standard.
As a stupid little example of it in action:
$ 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."
Also, as @GMan mentioned in a comment, GCC's list of C++0x compatibility can be found online.
Mark Rushakoff
2010-03-19 11:17:31
AFAIK all the thread and lock related stuff is missing yet, right?
frunsi
2010-03-19 11:19:00
List of supported features and their corresponding g++ version: http://gcc.gnu.org/projects/cxx0x.html
GMan
2010-03-19 11:20:02
The thread and lock stuff aren't listed on the features page, but the headers files are included with gcc 4.4 and the contents look like the new standard.
caspin
2010-03-19 15:07:45
@Caspin: The library status is tracked [here](http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.200x).
Georg Fritzsche
2010-05-29 22:54:49
+1
A:
Comeau -- try it out here. And no, I don't work for/affiliated with them ;) But they do a good job of compliance.
Intel also supports some C++0x starting with 11.0. (The current version is 11.1)
dirkgently
2010-03-19 11:22:07