C++23

C++23 has finally been accepted by ISO as the latest C++ standard ISO/IEC 14882:2024

For a useful summary of features see
https://www.cppstories.com/2024/cpp23_lang/
Thanks for the heads up.

Since their first feature discussed was the new consteval syntax, it would be nice if they showed off a practical use for it, instead of a contrived "multiply by 2 at compile-time" example that I would hope nobody ever puts in production code.
Edit: The link to P1938 in the article itself shows more useful examples. (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1938r3.html)

Multi-dimensional array subscripting is pretty cool!
#elifdef is nifty.

I had no idea P2718 (foreach loop temporary lifetime issue) was even a class of bugs. Gross.
Last edited on
P2718 can be a nasty bug. If caught it has a high fatality rate but now that there's vaccine-23 hopefully incidents will be eliminated.
Last edited on
Note that something like
 
for (auto& elem : getVector())
has always been fine.

It was things like
 
for (auto& elem : getVector()[0])
(where getVector() returned a vector of vectors) that caused problems before C++23.

Just saying, so that people don't think they had more bugs than they really had.
Last edited on
Registered users can post here. Sign in or register to post.