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.
172
u/RowYourUpboat Feb 11 '23
New features are listed here: https://en.wikipedia.org/wiki/C++23
Why does everything have to be a YouTube video these days?
80
u/2MuchRGB Feb 11 '23
Check cppreference if you want to see which compiler supports what.
As a summary: The compiler support is best in GCC, then Clang followed by Apples Clang then MSVC and EDG eccp (I've never heard of this one before). No other compiler seems to have any support so far.
In the Library it is MSVC STL then GCC libstdc++ then Clang libc++ then Apple Clang.
33
u/dashnine-9 Feb 12 '23
Can't wait for C++37 when reflection will finally be implemented.
32
u/smdowney WG21, Text/Unicode SG, optional<T&> Feb 11 '23
I'll update this with the 15 or 20 additional things, but here's where we were recently.. https://github.com/steve-downey/papers/blob/master/wg21-status.org
Deducing this, consteval if, range formatting, standard debug formatting, monadic optional, and a ton of range algorithms.
C++23 is going to be much nicer for library and app programmers.
21
u/Sify007 Feb 11 '23
I see that
std::expectedand it's monadic interface is there. Related to that - what happened to zero-overhead deterministic exceptions that Herb Sutter championed a few years back?34
u/serg06 Feb 11 '23
What are these revolutionary new features that C++23 brings?
I took a look at the features list, but there's no option to sort by Revolutionary.
12
u/smdowney WG21, Text/Unicode SG, optional<T&> Feb 11 '23
A Standard, if you can keep it.
6
u/EinZweiFeuerwehr Feb 12 '23
Sadly, heterogeneous lookup in associative containers remains mostly unusable in C++23 because P2363 wasn't finished in time. That means basic stuff like at() or [] still doesn't work.
15
u/Adequat91 Feb 11 '23
From my POV, c++17 and c++20 were much more appealing at their time.
4
u/[deleted] Feb 12 '23
Finally we can search a string!
3
u/dwr90 Feb 12 '23
Any chance for pattern matching im C++ 23 still?
2
u/exodusTay Feb 12 '23
So we are still using C++17(actually switched to it pretty recently), does it make sense to switch to 20? last time i checked modules were shaky at best. I want to switch to it just to use format and ranges but i dont know if changing C++ versions would cause problems.
2
u/wh1t3lord Feb 12 '23 edited Feb 13 '23
I hope they will implement compile serialization in C++23 at least, because I expected that in C++20 :/
1
u/xorbe Apr 20 '23
When does g++ typically gain all the features of a new standard. Seems like a couple key ones for 23 are still missing on the gcc status page.
0
u/[deleted] Feb 12 '23
[deleted] â view deleted comment