upvote
No. C++ doesn't have a garbage collector, and it doesn't have a borrowck, as a result any reference types are subject to ordinary human error because it can't garbage collect the target objects and it doesn't know when to destroy them otherwise.

The work to try to address this for C++ 29, half-finished and untried as it is - is extremely restrictive, you'd likely hate it, and that's just to solve this, the relatively easy problem.

Thing is, Rust wasn't content just to solve that easy problem. (Safe) Rust also doesn't have data races. The C++ standard doesn't say very much about data races, can't help you ensure they don't happen - it just explains that if they do that's Undefined Behaviour, game over.

reply