C++ is about performance over safety these days. It would have to fundamentally change in order to give the tools enough information compete with Rust on the memory safety front. And it's just not going to fundamentally change at this point.
The technical reasons are many, and they've been gone over many times before. I'm not going to reiterate them here. Many of the problems are in the STL, but since almost everyone that uses C++ will use the STL (and yell down anyone who tries to create something better) they are one and the same for the purposes of this argument.
Classes like unique_ptr, shared_ptr, and vector have done a great deal for making C++ safer (to the point that I no longer think of memory safety as an issue). Additional new classes or language features can help in making C++ even safer. As with so many things, it doesn't have to be perfect; it just has to be good enough.
4
u/eyes-are-fading-blue Dec 07 '21
Care to elaborate why it is impossible?