Last Update:
C++ at the End of 2018
Table of Contents
2018 is almost over (just a few hours left in Poland till midnight). As in previous years, I did a summary of many things that happened in the C++ community. This year seems to be marked with a solid progress towards the standardisation of C++20, using more and more C++17 and as always the growth in the community.
Let’s have a look.
Other Reports:
2020 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012.
Intro
Here are the main things for this year that got my attention:
- C++17 adoption
- SG20 group - the importance of teaching
- C++ growing
The first thing is C++17. The new standard was accepted at the end of 2017. This year we see more and more projects that start to leverage the new language and library features. I appreciate the speed of implementing new features in compilers. Now, you can use all of the language features and probably 95% (parallel algorithms) library features in GCC, Clang and MSVC.
The second key aspect is a new study group in ISO C++: SG20. It was just started (“founded” in the San Diego ISO meeting, November) but should be important for our community and drive the efforts for making resources for teaching/learning C++ better and better.
And, the last element is the statement that C++ is growing. It’s a quite general opinion, but we can see it from many perspectives:
- growth as standardisation: we’re now in good shape for C++20
- growth as community: there are many new user groups, new conferences start to appear and even the number of papers with proposal reached historic maximum.
Read on to get the full picture.
Timeline
To have an overview:
C++11/14 compiler status
For the reference Clang (since 3.4 ), GCC (since 5.0) and Intel (version 15.0) already have full support for C++11/14.
Visual Studio finally announced full conformance with C++17… and that
also means the support for C++11/14. Now, you can build such complex
codebases like boost::hana
or range v3
.
Since C++11/14 is supported in all major compilers, you have no excuses not to use modern C++ :)
Compiler support for C++17
In December 2017 C++17 was published as ISO/IEC 14882:2017 Programming languages – C++.
You can download a free version of the last draft: N4700, 2017-10-16, PDF.
The full version of compiler support can be found @cppreference: C++17 compiler support, here I’ll focus on the most important parts (extending with the info about Intel Compiler).
Regarding Language features - MSVC, GCC and Clang support all!
The problematic parts: parallel STL is available so far only in MSVC, and also in Intel (as their Intel Parallel STL implementation).
Intel offers their Parallel STL implementation to GCC and Clang implementations; we should see the updated versions soon (maybe GCC 9.0? and Clang 8.0?).
(*) N/A
for Intel with std::filesystem
- Intel does not ship with
its Standard Library implementation, it relies on the platform STL.
C++20
The new language standard is evolving, and the feature list is not stable.
You can read about the support on the following pages:
- C++2a Support in GCC
- Clang - C++20 status
- libc++ C++2a Status
- Visual C++ Language Conformance | Microsoft Docs
For example, you can play with Designated initialisers (P0329R4) since GCC 8.0.
struct Vec { int x; int y; int z; };
Vec actorPos {.x = 1, .y = 2,.z = 3};
Or checking for string suffix, prefix (starts_with
and ends_with
)
(P0457R2) is available since Clang 6.0:
There’s also a public version of # Howard Hinnant’s Date library that will eventually be implemented as Calendar in STL (D0355R7):
Plus, you could play with many Technical implementations for Modules, Ranges, Concepts even before they were (or will be) merged into the Standard.
ISO C++ meetings
There were three committee meetings this year - in Jacksonville, Rapperswil and San Diego. All of the sessions were devoted to C++20.
The plan for the meetings is available here: Upcoming Meetings and Past Meetings: Standard C++
March: Jacksonville, FL, USA
Many features were voted into the Standard, and probably the most significant addition is the Calendar library: Calendar and timezone library.
Here are the trip reports:
The main report, located at r/cpp:
2018 Jacksonville ISO C++ Committee Reddit Trip Report :
cpp
Other reports:
* Trip report: Winter ISO C++ standards meeting (Jacksonville) |
Sutter’s
Mill
* GoingNative 65: ISO C++ @ Jacksonville Debriefing | C9::GoingNative
| Channel
9
* Jacksonville Trip Report -
CppCast
* Vittorio romeo’s Trip
Report
* Oh, lock-free circular buffers, yay! Hey, no 2D graphics?
Jacksonville trip report
* Text Formatting at the ISO C++ standards meeting in
Jacksonville
June: Rapperswil, Switzerland
This time the committee met outside the USA… and the location was in Europe.
Among many things, the biggest addition to C++20 was Contracts. And we also got Standard library concepts, Class non type template parameters (NTTP), Feature test macros and many more.
The main trip report:
2018 Rapperswil ISO C++ Committee Trip Report (Contracts for C++20;
Parallelism TS v2 published; Draft Reflection TS) :
cpp
Other trip reports:
- GoingNative 67: ISO C++ @ Rapperswil Debriefing | C9::GoingNative | Channel 9
- Herb Sutter - Trip report: Summer ISO C++ standards meeting (Rapperswil)
- Botond Ballo -Trip Report: C++ Standards Meeting in Rapperswil, June 2018 | There’s Waldo!
- Rapperswil Trip Report - CppCast
- ISO C++ Committee – Rapperswil 2018 trip report | CLion Blog
- 2D or not 2D: that is the question: Rapperswil trip report – World of hatcat
November: San Diego, CA, USA
The third meeting this year was the biggest one in history!
The pre-meeting mailing had 274 papers, about twice as many as any previous meeting, and we had 180 people attending, making this the largest C++ committee meeting ever.
This was also an important meeting regarding new features, as we got Ranges into the Standard!
Another element - Modules - two approaches were merged into one and we now have a single concept that needs to be improved. That’s a good sign, and there is a good chance modules will be on time for C++20.
At this meeting, we also got a new study group: SG20. See this post for
more information about this group.
SG20 Education and Recommended Videos for Teaching C++ | Christopher Di
Bella
The main trip report at r/cpp:
2018 San Diego ISO C++ Committee Trip Report (Ranges v1 TS for C++20;
consensus on modules design; new Language and Library Evolution
Incubators) :
cpp
Other trip reports
- Pre-trip report: Fall ISO C++ standards meeting (San Diego) | Sutter’s Mill
- Herb Sutter - Trip report: Fall ISO C++ standards meeting (San Diego)
- Botond Ballo - Trip Report: C++ Standards Meeting in San Diego, November 2018
Compiler Notes
Current versions and most notable updates.
Visual Studio
Current version VS 2017 update 8 - 15.9 - Release notes
- last updated in December 2018.
There’s also Visual Studio 2019, preview version:!
Probably the most important story for VS is the conformance with the
Standard! The Visual Studio team has made significant progress to be
able to compile C++11… C++14 and even C++17! Now, you can work with many
super complex code bases like range v3
or boost::hana
.
Announcing: MSVC Conforms to the C++ Standard | Visual C++ Team Blog
Some other news:
- Announcing C++ Just My Code Stepping in Visual Studio
- std::string_view: The Duct Tape of String Types
- Use the official Boost.Hana with MSVC 2017 Update 8 compiler
- Using C++17 Parallel Algorithms for Better Performance
- STL Features and Fixes in VS 2017 15.8
- std::any: How, when, and why
- How to Use Class Template Argument Deduction
- Exploring Clang Tooling Part 3: Rewriting Code with clang-tidy
- Use the official range-v3 with MSVC 2017 version 15.9
- Better template support and error detection in C++ Modules with MSVC 2017 version 15.9
GCC
Current stable version GCC 8.2, July 14th, GCC 8 Release Series Changes
Clang
Current stable version: 7.0 - 19th Sept 2018, Release Notes
Notable news:
- LLVM Project Blog: Clang is now used to build Chrome for
Windows
- similar thing for Firefox: Using clang-cl to ship Windows builds - Google Groups
- Current C++ Support in Clang
- libc++ C++1z Status
Intel compiler
The Version 19.0.1 appeared in February 2 (XE 2018) (release notes)
- C++14 Features Supported by Intel® C++ Compiler
- C++17 Features Supported by Intel® C++ Compiler
- Intel offers Parallel STL implementation to GNU libstdc++ : cpp
Tools
While compilers do the primary job with our C++ code, we cannot forget about the importance of other tools.
Here are some notable tools that it’s worth to know:
Clang Tools:
Clang/LLVM powers many great tools! For example:
- Clang Tidy
- Clang-Include-Fixer
- AddressSanitizer
- MemorySanitizer
- For Visual Studio you can use: Clang Power Tools - Visual Studio
Marketplace.
- Developed by Victor Ciura (@ciura_victor)
- The version 4.5 available since Dec 12th. See changelog
IDE and Productivity
- Visual Assist - Latest version from October. Read more on the VA blog
- ReSharper C++ - 2018.3
- CLion - it’s current version is 2018.3
Code Analyzers:
- CppDepend v2018.2 - Clang 7.0, SonarQube, Clang Tidy and more - see
all of the changes
here
- separate version changes.
- PVS-Studio - a tool for bug detection in the source code of
programs, written in C, C++, and C#. It works in Windows and Linux
environment
- Here’s my blog post about using all of the information PVSStudio
team shares (from 2017):
Learning from bugs and PVS-Studio Team - You can also use it for free: Free PVS-Studio for those who develops open source projects
- Here’s my blog post about using all of the information PVSStudio
team shares (from 2017):
Package managers:
- Conan - Conan reached the stable version
1.0 this year, and now is in 1.8 (see blog post).
This year I also made few blog posts where I used this handy tool: - Microsoft/vcpkg: VC++ Packaging Tool - open source C++ Library Manager for Windows, Linux, and MacOS.
Conferences
I am pleased to see that more and more C++ conferences are appearing. We have at least four strong points:
- CppCon
- C++Now
- Meeting C++
- ACCU
But there are more: like Code::Dive, Italian C++ Conference, PacifiC++, C++ Italian Day or C++Russia.
It’s also amazing that if you haven’t been at a conference, you can quickly type its name in YouTube and find most of the lectures from it. You can easily find trip reports using some web search engine.
Just in case here’s the link to ISO C++ page with all registered conferences around the world: Conferences Worldwide, C++ FAQ.
Community
I am delighted that my city - Cracow - continued its C++ group this year: C++ User Group Krakow - join if you’re nearby!
If you don’t have a User Group close to your place (but please check User Groups Worldwide), you can also participate in:
- C++ Slack channel: https://cpplang.now.sh/
- #include
Books
Some of the books released this year worth seeing:
And two notable mentions about C++17:
As usual, for the last few years…
I am still waiting for Large-Scale C++ Volume I, John
Lakos…
Popularity
Where is C++ regarding popularity? JavaScript is now everywhere, websites, cloud, etc., etc… still, C++ is not forgotten!
Let’s have a look at some charts/stats:
- Tiobe shows C++ on the 4th place. It’s now 7.5%… but with a growth. In 2017 it was only 5.5%. See the chart here: Tiobe Index.
- In the StackOverflow Survey C++ is positioned at 10th place, above C
(but below Java, C# and of course JavaScript)
- Stack Overflow Developer Survey 2018
- See about their projections and how Python seems to be the king now.
- In GitHub survey C++ has a 5th place and moved from the 6th position that it had in 2016.
In my opinion, C++ has a stable position in many industries. And there’s one huge area that needs more C++: it’s embedded and automotive. Correct me if I’m wrong, but it looks like this industries, which were mostly dominated by C, and even asm, now can use C++ and take benefit from its features.
Your Input & Survey
On Friday I started my survey about C++. I got more than 200 answers and here are some stats and notes.
(nice charts will be added later :))
C++ Standard Used:
- Pre C++11 - ~20%
- C++11 - ~41%
- C++14 - ~42%
- C++17 - ~44%
(The numbers for the above do not sum to 100%)
Experience with C++11/14:
- ~51% - you know and use a lot of features
- ~36% - you use a few features
- ~9% - you know a few features, but not using much
- ~2% responded that they don’t know any of C++11/14 feature
Experience with C++17:
- ~48.5% - experimenting with C++17
- 24% - only read basic information
- 17.5% - already using in production
- 7% - don’t know any of its feature
Compilers Used:
- GCC - 73,5%
- Cang 41%
- MSVC - 59%
- Intel Compiler 3%
(The numbers for the above do not sum to 100%)
Best thing that happened, sorted by popularity:
- CppCon 2018
- Visual Studio finally being C++17 compliant
- C++17 supported by popular compilers
- Ranges Merged into C++20
- It’s evolving faster than ever, progress for C++20
- Better and better C++ Resources (Blogs, Videos, online talks)
- Concepts
- Modules on track for C++20
- Contracts
- Clion 3 & WSL
- C++ Russia
But of course, there were much more interesting events you mentioned. For example, someone did his first talk at a conference/meetup or went at first C++ conference. A lot of you said tools like Conan, Clion, CMake.
I also have to brag a little bit, as you also expressed positive feedback about my book :) For example
“C++17 In Detail” comes handy to understand new features
Thanks for that!
There were also a few notes about C++ getting too complicated… but more on that in a separate section.
Other Surveys
Regarding surveys, The C++ Committee also sent us a survey, in February. They managed to gather more than 3200 votes. This doesn’t represent all C++ programmers in the world (estimated to be like 3…5 mln!), but gives a lot of useful insights.
Have a look:
- ISO C++ survey
- and the results
Also, JetBrains created their poll which you can see in this article: The Developer Ecosystem in 2018: Key Trends for C and C++ | CLion Blog.
The C++17 standard was officially signed last year and is now seeing growing adoption numbers: 18%, compared with 12% last year. However, while nearly half of all respondents who are not on C++17 yet plan to upgrade to one or another new standard, only 8% of those who are not on C++17 however are considering moving to C++17 in the next 12 months.
Lamentations
Surveys, end of the year, summaries… brings us to the topic of Lamentations about C++ :)
The whole and valid discussion were started by Aras P. at his gamedev blog:
“Modern” C++ Lamentations · Aras’ website
And here are the comments and additional posts that added more into the discussion:
- Standard Ranges – Eric Niebler - the blog post that described Ranges and showed a bit complex example of how to use them.
- /r/cpp discussion thread for Aras’ post
- /r/programming discussion for Aras’ post
- A Perspective on C++ Standardization in 2018 | The Pasture
- /r/cpp Do you use a debugger much?
I’ve also seen similar examples in my survey, where people expressed that C++ is getting too complicated, compile time getting slower and slower, the entry barrier is high for new people.
The language is evolving very fast, new features are added, some are removed. As with every project, there are risks and even some “bugs” that happen along the way. The discussions I see now, shows that there are a lot of people that care about the language. We all want to have strong and useful C++ so that we can do our tasks efficiently. I believe we can solve many problems together. The ISO Committee is very large now and should, hopefully, represent the interests of many groups, not only academic C++ but also gamedev, financial, embedded and many more.
One of the answers to “complicated C++” might be the new study group that will hopefully guide the teaching in the community. This should improve the overall knowledge about C++ and give us better resources to teach and learn.
Summary
Three things that I’d like to emphasise for the year:
- C++17 adoption
- SG20 group - the importance of teaching
- C++ growing (in many ways)
(This post might be filled with typos, grammar issues, sorry for that I hope to improve it during the next few days).
Your turn
- What do you think about C++ in 2018?
- What was the most important event/news for you?
- Did I miss something? Let me know in comments!
I've prepared a valuable bonus for you!
Learn all major features of recent C++ Standards on my Reference Cards!
Check it out here:
Similar Articles:
- How To Parallelise CSV Reader - New Chapter
- C++ Links #11
- How to Boost Performance with Intel Parallel STL and C++17 Parallel Algorithms
- C++ Links #10
- C++ Links #9