Hacker News new | ask | show | jobs
by Calavar 652 days ago
You can find std::string_view (C++17) in Google's WebGPU implementation [1], static_assert (C++17) in Protobufs [2], <bit> (C++20) in React Native [3], and std::format (C++20) in Cuda Core Compute [4]. So the big names in tech aren't afraid to add -std=c++20 to their build scripts. On the other hand, C++23 features aren't as common yet, but it's still very fresh and MSVC support is WIP.

[1] https://github.com/google/dawn/blob/40cf7fd7bc06f871fc5e4823...

[2] https://github.com/protocolbuffers/protobuf/blob/c964e143d97...

[3] https://github.com/facebook/react-native/blob/77b3a8bdd6164b...

[4] https://github.com/NVIDIA/cccl/blob/07fef970a33ae120c8ff2a9e...

2 comments

I'd venture a guess that string_view, static_assert and bit were already a part of respective codebases, just in-house versions. These are very commonly used. So seeing them getting adopted is completely unsurprising.

However the adoption rates of newer C++ features are in fact new are way lower. From what I see lots of projects still use the language as C with Classes, basically, and that ain't going to change any time soon. The GP nailed it - C++ is adding a lot of esoteric stuff that very few people actually need or want.

Imagine how widespread use of Java 8, .NET Framework, Python 2, C89 is still around the industry and now apply it to C++ versions.

There is a reason why C++17 is the best we can currently hope for in what concerns portable code, given the actual support across industry compilers, and company project guidelines.

Many embedded shops might still be discussing between adopting C++11 or C++14.

I agree, but there's a big difference between saying some industries or companies are still targeting old standards and saying there's "near zero" adoption of new standards. The latter just isn't accurate from what I see.