Re:Elements of Modern C++ Style
by gcv on Saturday October 29, 2011 @10:41AM
(#3171966)
That looks surprisingly good, and might even improve new projects which have to use C++. How long until compilers support all this?
[ Parent
| on HN ]
Re:Elements of Modern C++ Style
by obiterdictum on Saturday October 29, 2011 @10:51AM
(#3171987)
I'd say by the middle of next year you should be able to use the a lot of the features portably.
GCC: http://gcc.gnu.org/projects/cxx0x.html
Clang: http://clang.llvm.org/cxx_status.html (currently down)
MSVC: http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.a...
Notably lacking in current production versions:
1. explicit overrides in GCC
2. lambdas in Clang
3. Variadic templates, range loop in MSVC
Sadly, vendor supplied toolchains for other systems are going to lag far behind. It is not always an option to use GCC/Clang on these boxes. Compilers like Oracle Studio CC, IBM xlC, and HP aCC, etc. So this is not really the definition of "portable" I'm used to. I know I can take any C++98 code and reliably build on any platform/toolchain. It will be a long time before I can say the same about C++11. Even C99 isn't truly "portable" because Microsoft refuses to add all C99 features to MSVC.
To be honest, I can understand why, as C++98 and C99 are (aside from some trivial features) mostly different and incompatible extensions to C90.
Microsoft don't ship a C compiler
Adding C99 features to their C++ compiler would be nice be probably not cost effective for them
Re:Elements of Modern C++ Style
by maximilianburke on Saturday October 29, 2011 @10:34PM
(#3173468)
Sure they do, it's bundled with their C++ compiler. cl.exe will happily turn on C90 mode and compile files as C, not C++, if you supply the /TC option or your source files have the .c extension.