I know anything other than switching to Rust is a losing battle of compromises in some sense, but many of us working with huge codebases written in C++ don’t have the luxury of that choice being unavailable.
I know anything other than switching to Rust is a losing battle of compromises in some sense, but many of us working with huge codebases written in C++ don’t have the luxury of that choice being unavailable.
Sure you mist avoid a few things but there are alternatives on what to do instead/not what to do.
- you can use string_view more conservatively
- you can stick to value semantics.
- use spans in things that do not escape.
- use smart pointers.
- do not capture escaping lambdas that have capture by reference.
If you go wild raw pointers willy-nilly around, then yes, you are gonna have a plague of sh*t because you are an incompetent using C++. I do not expect people to play the violin or drive a car without a minimal of training.
So suggesting a disciplined usage of c++ sounded like a hard sell. It's helpful that you elaborated on the details.