Meeting C++ survey results: the most popular C++ standard features

published at 29.04.2021 13:52 by Jens Weller
Save to Instapaper Pocket

Continuing the series about the Meeting C++ survey results with a look at the standard features. Last week I compared the ISOCPP survey to the one of Meeting C++.

... by the way, I'm giving a talk next week at C++Now about the survey. If you take the survey now, you can still help me with this talk a lot!

When I was looking into the questions I could ask in the survey tool, it came to my mind that it would be interesting to know more about the details of standards, not just asking for which standard folks use in various ways.So in this blog post, I'm going to show you the questions about standard feature usage. These are split into language and library, and we'll take a look at C++11, C++14 and C++17. A few weeks ago I also created this question for C++20, but right now it only shows that ~70% isn't using C++20. So likely going to disable this question for a while soon.

But lets start with a graph which I already showed in an earlier post, which standard containers are used?

survey/2020_std_containers_used.png

Followed by the standard & librariy features of C++11

survey/2020_cpp11lang.png

As you see some standard features are more popular then others. Trailing return types is something that did not catch on with the masses it seems. Other features which seem not to popular are often "niche features", not relevant in all use cases and hence not used every day. This is different for auto, lambdas and nullptr.

survey/2020_cpp11lib.png

When looking at the library features, it becomes clear that the standardization of memory management facilities such as unique_ptr was very successful. Though I find it a bit scary that shared_ptr is at the second place, with a few multi threading features coming close.

Lets move on to C++14.

survey/2020_cpp14lang.png

The C++14 standard is a release that fixed and enhanced C++11 in a few ways. It relaxed constexpr and added functionality to lambdas. I think variable templates and binary literals are two of the more interesting contributions to C++ from this standard.

survey/2020_cpp14lib.png

Look at this graph! C++14 did not bring much to the library. Some of this are also fixes or additions to existing C++11 lib features, you might not even be aware of some of these changes as C++14 features when using them. Thats why only 4 features made it into this graph. And I think a few more are hidden in other, with either being to long in name to make sense in an option or too niche. Lets move on to C++17.

survey/2020_cpp17lang.png

C++17 has its strenghts in features, it really simplyfied some things in C++. Though some of the big features like concepts did not make it. But with structured bindings, if constexpr and nested namespaces it does have some popular features. Especially if constexpr will have safed some of us from writing an enable_if and using SFINAE.

survey/2020_cpp17lib.png

One of the library features that everyone wanted in C++14 was filesystem. Its nice to see that it is popular with C++17. Only beaten by string_view and optional. Which are two new standard types enabling a much cleaner and better use of C++. Together with any and variant these types have been popular in boost for a while. Special Mathfunctions is being followed up by Mathematical constants in C++20.

And thats it for this installment of this series. As I said, C++20 is not used enough right now, to take a look at any results.

Join the Meeting C++ patreon community!
This and other posts on Meeting C++ are enabled by my supporters on patreon!