Maxatar 3 days ago

There are plenty of things between C++11 and C++23 that have been removed and hence won't compile:

Implicit capture of this in lambdas by copy.

std::iterator removed.

std::uncaught_exception() removed.

throw () exception specification removed.

std::strstream, std::istrstream, and std::ostrstream removed.

std::random_shuffle removed.

std::mem_fun and std::mem_fun_ref, std::bind1st and std::bind2nd removed.

There are numerous other things as well, but this is just off the top of my head.

3
bluGill 3 days ago

None of those things I've never used. Many of those are in bad practice for C++11.

lmm 2 days ago

Sure. But per your own other posts in this thread, you've got > 10 million lines of "legacy C++". Probably those bad practices are present in that code and not automatically fixable. So switching to compiling everything with a C++23 compiler is every bit as much not an option for you as switching to Rust, no?

bluGill 2 days ago

If I turn on C++23 and get a handful of errors over those million lines of code I will spend the week or two needed to rewrite just those areas of code. That is much easier than rewriting everything from scratch in rust. Even if we just wrap all needed C++ APIs in C so we can use rust that is a lot of effort before all our frameworks have the needed interfaces (this is however my current plan - it will just be a few years before I have enough wrappers in place that someone can think about Rust!)

Note too that we are reasonably good (some of us are experts) at C++ and not Rust. Like any other human when we first do Rust we will make a mess because we are trying to do things like C++ - I expect to see too much unsafe just to shut up Rust about things that work in C++ instead of figuring out how to do it in safe rust. (there will also be places where unsafe is really needed) I want to start slow with Rust so that as we learn what works we don't have too much awful code.

zozbot234 1 day ago

> Like any other human when we first do Rust we will make a mess because we are trying to do things like C++ - I expect to see too much unsafe just to shut up Rust about things that work in C++

C++ has its own Core Guidelines that are pretty rusty already (to be fair, in more ways than one). There's just no automated compiler enforcement of them.

j16sdiz 2 days ago

cppreference say strstream is removed in C++26, not C++23.

I knew they are bad, but I don't think it should be removed.

delduca 2 days ago

std::shared_ptr::unique()