C++11/14 compiler and library shootout
cpprocks.com
cpprocks.com
That said, I sort of worry about the new approach to C++ standards. It was nearly a decade between C++03 and C++11 (duh) and C++03 was a very minor set of changes compared to C++98. Now we are planning to have major changes every six years, with a minor release in between? That's a new standard every three years. It seems hard to imagine how the compiler developers are going to keep up with that, much less our libraries.
Considering the C++ world is already very fragmented in terms of style and features used (C with Classes, Modern C++, horrible in-between?), I don't know if C++17 is going to be good for the ecosystem. I mean, people are talking about adding everything from monads[0] to compile-time reflection[1].
If the designers were willing or able to remove features (do we really need two different initialization syntaxes?) then I would be less concerned, but intentionally breaking every existing C++ library would probably do more harm than good.
Overall, I'm just not sure that this aggressive schedule of adding new features to a large language is a great idea.
[0] http://bartoszmilewski.com/2014/02/26/c17-i-see-a-monad-in-y... [1] http://cpptruths.blogspot.com/2014/03/why-we-need-compile-ti...
C++11 is much better and much more intuitive than older versions. Still it feels like tearing down a tree with a kitchen knife sometimes.
There's nothing modern about any feature that's been introduced into a popular programming language in years. They're all rediscoveries or minor iterations on things invented decades ago.
It's usually not the features that are described as being "modern," though. It's the style that's described that way, and there is a marked difference between the style of, well, modern C++ code and the style of C++ code written in the '90s.
It remains to be seen how well vendors keep up, but I think that's more a measure of interest than technical limitations. If the modernization of the language reinvigorates its use, they'll resource the compiler teams for it.
"Avoiding/fusing memory allocations"
It lists Clang but nothing else as supporting it.
This sounds like a compiler optimization and not a language feature, and since it's talking about C++14 (not C++11) I know this isn't referring to move semantics/rvalue references.
What exactly is this?
int f() {
int * x = new int(0);
return *x;
}
does not really need to allocate memory, and so that `new` is now explicitly allowed not to. Similarly, int f() {
int * x = new int(0);
int * y = new int(1);
return *x + *y;
}
Here the standard allows not only to elide both allocations, but also to fuse them into a single (faster) allocation.[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n366...