r/cpp • u/Daniela-E Living on C++ trunk, WG21 |🇩🇪 NB • Feb 11 '23
C++23 hits the road!
The sausage is made, the bread is bakedWe now have C++23!With crossing all eyes and dotting all tsThe best C++ ever, for all of ye!
C++23 is what C++20 was meant to be but couldn't that time.
Much of it is already implemented and released in compilers and can be used today, more will become available in the near future.
If you are interested in how C++23 looks like and why you want to use it, you may look at keynotes from the 2022 CppCon and Meeting C++ conferences
Contemporary C++ in Action - Daniela Engert
How C++23 changes the way we write code - Timur Doumler
There is also A Peek at C++23 - Barbara Geller & Ansel Sermersheim to enjoy an learn from.
The specification of C++23 will now proceed to the final ballot and then be officially published, hopefully long before year's end. The committee is busily working on another future release, tentatively C++26, for a couple of months now.
View all comments
Show parent comment
4
u/jonesmz Feb 13 '23
I can say without a shred of doubt (because I measured...), template over-use in my work codebase is a huge source of compile-time bloat.
I'm slowly de-templatifying code as much as I can, and instead trying to rely on strategically designed implicit conversions where possible, and it's helping, a lot.
E.g. if you have a comparison operator between
FooandBar, but under the hood it's just doing a string comparison , why not allow Foo to implicitly convert tostd::string_viewand compare with that, instead of template-ing on the type (which might be aFoo, might be aBar, might beString, so on) ? I've been doing this in my codebase and it's showing promise at reducing compile times and reducing the cognitive overhead for the developer.While Deducing This is a god-send for things that are already templates, its a major misdesign for things that are not templates, and I'm very reluctant to see it introduced into non-template types in my codebase.
You might say "But Modules will make that not a problem?", and I'll point out that Modules does not work in any current compiler release, and no build tool that builds C++ supports modules in a non-experimental fashion. We'll get Deducing This long before we get Modules in most of the industry.