Comment by blurgrin
2 days ago
> Our historical data for C and C++ shows a density of closer to 1,000 memory safety vulnerabilities per MLOC.
Unfortunately, I've never seen a version of this data targeting modern C++ (>=11, with smart pointers, already 15 years old).
Chromium is 17-20 (excluding some features they think are footguns) and even has its own MiraclePtr.
There's no True Scotsman C++. All C++ codebases would be perfectly safe, except the ones that people actually wrote.
Note that Rust has been created after C++ already had smart pointers. Rust treated "modern" C++ as safety failure to be replaced, not as an unrealized competitor. This is still a problem with the C++ WG today: their most ambitious safety ceiling is aiming below Rust's floor.
Because it doesn't exist, I have never seen modern C++ in real life as in conference slideware.
Most projects keep being full of C idioms, regardless of how much advocacy we keep pushing for.