Maybe I’ll be boring with this note, but again I need to write that this was another good year for C++!
Here’s a bunch of facts:
- Visual Studio 2015 was released with great support for C++14/17 and even more experimental features.
- Long-awaited GCC 5.0 was released at the beginning of the year.
- C++ gained a huge boost is popularity around July, 3rd stable place in the Tiobe Ranking
- At CppCon 2015 there were some really important announcements made.
- C++17 seems to be just around the corner!
- And one sad news...
See my full report below.
- Features
- Missing C++11 features
- C++14 - core language features
- C++17
- Core Guidelines
- Notes on the C++ Standard
- Compiler Notes
- Visual Studio
- GCC
- Clang
- Intel compiler
- Conferences
- Summary
- What do you think?
Features
Missing C++11 features
Just for the reference Clang, GCC and Intel Compiler have full support for C++11.
- Visual Studio:
- Expression SFINAE - N2634
- C99 preprocessor - N1653
- Update: previously I've listed here 'Atomics in signal handlers' - as missing, but I skipped one note written here by StephanTLavavej - " I previously listed "Atomics in signal handlers" as No, because despite maintaining <atomic>'s implementation, I didn't know anything about signal handlers. James McNellis, our CRT maintainer, looked into this and determined that it has always worked, going back to our original implementation of <atomic> in 2012. "
- So, all in all, this feature is working as expected since 2012.
C++14 - core language features
Clang and GCC fully implement C++14.
Feature | Proposal | Clang | GCC | VS | Intel |
Tweak to certain C++ contextual conversions | N3323 | 3.4 | 4.9 | 12 | *16 |
Binary literals | N3472 | Yes | 4.9 | 14 | 14 |
Return type deduction for normal functions | N3638 | 3.4 | 4.9 | 14 | 15 |
Generalized lambda capture (init-capture) | N3648 | 3.4 | 4.9 | 14 | 15 |
Generic (polymorphic) lambda expressions | N3649 | 3.4 | 4.9 | 14 | *16 |
Variable templates | N3651 | 3.4 | 5 | - | - |
Relaxing requirements on constexpr functions | N3652 | 3.4 | 5 | - | - |
Member initializers and aggregates | N3653 | 3.4 | 5 | - | *16 |
Clarifying memory allocation | N3664 | 3.4 | n/a | - | - |
Sized deallocation | N3778 | 3.4 | 5 | *14 | - |
[[deprecated]] attribute | N3760 | 3.4 | 4.9 | *14 | *16 |
Single-quotation-mark as a digit separator | N3781 | 3.4 | 4.9 | *14 | *16 |
Changes (from the last year version) marked with a star (*)
Visual Studio 2015: the compiler is getting closer to the full conformance, they’ve implemented Sized deallocation, [[deprecated]] attribute and Single-quotation-mark as a digit separator.
Intel has also made a good progress, they’ve added support for generic lambdas, member initializers and aggregates, [[deprecated]] attribute and Single-quotation-mark as a digit separator.
C++17
Obviously most of us are waiting for something big that should happen in relatively short period of time: C++17 should be standardized! Compilers has still some work to do on the full C++11/14 conformance, but most of the features are there for us. Most of the compiler teams actually moved into experimenting with some of the new features.
But what is C++17?
To get the best idea it’s probably best to read “Thoughts about C++17” (PDF)
by Bjarne Stroustrup. He mentioned the tree top priorities:
- Improve support for large-scale projects
- Add support for higher-level concurrency
- Simplify core language use, improve STL
Moreover, C++17 is a major release, so people expect to get something important, not some little updates.
What’s on the list then?
Here is a great and detailed overview of what features might be ready for Botond’s C++17: Trip Report: C++ Standards Meeting in Kona, October 2015
Also, the features that won’t be ready will be shipped with C++20 that is planned to be a minor release. C++20 will complete C++17 as C++14 completes C++11.
Core Guidelines
At CppCon in the keynote presentation, Bjarne made an important announcement: Core guidelines!
Full guidelines can be found at github - isocpp/cppcoreguidelines, here is a quote from the introduction:
The C++ Core Guidelines are a collaborative effort led by Bjarne
Stroustrup, much like the C++ language itself. They are the result of
many person-years of discussion and design across a number of
organizations. Their design encourages general applicability and broad
adoption but they can be freely copied and modified to meet your
organization’s needs.
The aim of the guidelines is to help people to use modern C++
effectively. By “modern C++” we mean C++11 and C++14 (and soon C++17).
In other words, what would you like your code to look like in 5 years’
time, given that you can start now? In 10 years’ time?
Since the language is getting more complicated, modern, and even simplified at the same time it’s very welcomed to have a guide that will help to write good modern C++ code. Some older rules are now superseded by new approaches - for example RAII. It’s not that easy especially when you’re working on a legacy code and you’d like to add some fresh modern code into your project.
Guidelines are developed collaboratively, so it seems the rules should be practical.
The main keynote from Bjarne:
CppCon 2015: Bjarne Stroustrup “Writing Good C++14”
It was later described with working examples by Herb in his talk:
CppCon 2015: Herb Sutter "Writing Good C++14... By Default"
Notes on the C++ Standard
This year, as expected, there were two meetings: Kona in October and Lenexa in April.
The Fall meeting:
And here are the links from Spring meetings:
Next meeting are announced, it will be in Jacksonville, Florida in February. Then, there will be a very important meeting in Oulu, Finland at the end of June - important because Draft for C++17 will be voted there.
Compiler Notes
Visual Studio
GCC
Clang
Intel compiler
Conferences
This year two C++ conferences gained my attention: CppCon and MettingCpp.
CppCon
MeetingCpp
The first keynote:
Understanding Compiler Optimization - Chandler Carruth - Opening Keynote Meeting C++ 2015
And the second one:
Creating intuitive APIs - Lars Knoll - Closing Keynote Meeting C++ 2015
Books
Here are some books about C++ that appeared in 2015
Alert! Amazon links below :)
Summary
My top events for C++ in 2015:
* Core Guidelines announcement
* VS 2015 release
* Lots of experimental features available to play.
As we can see C++ Standardization Committee is working hard to bring us C++17 that really includes huge and important features. At the end of the next year we should be seeing the full C++17 draft accepted.
Developers seem to like the current atmosphere around C++ and it was reflected in the July’s Tiobe Rank, where C++ reached 8%! Maybe the term “C++ renaissance” is not a myth…
What’s even better, we have lots of experimental work already in our compilers. We can play with modules, concepts, ranges, co-routines… This might not be safe for your production code, but definitely it’s great for learning and testing this new stuff. Feedback gained from those early-staged implementation might be very valuable when the final spec is realized. And, I hope, the committee will include that feedback in their work.
VisualStudio team become more open, they’ve done huge improvements with the latest release of VS 2015. Not only you can create multiplafrotm apps (thanks to embedding Clang) but also they are quite fast with new, experimental C++ features.
All compilers implement core parts of C++11/14, so there is no excuse not to write modern C++! With the help of Core Guidelines this task should be much easier. Please add it to your new year’s resolution list! :)
The Sad News
Just a few hours after I published my original post there was a message posted from Scott Meyers on his blog: "} // good to go"... that basically says that Scott Meyers is retiring from the world of C++ ;/
See more fresh comments on this reddit thread: link here
What do you think?
- What do you think about C++ in 2015?
- What was the most important event/news for you?
- Did I miss something? Let me know in comments
Thanks for comments:
CodeProject