Note I was explicitly objecting about null pointers begin impossible to avoid. My claim is that the C++ type system allow avoiding them just fine.
I'm making no claim about general the memory safety of C++, and its issues are well known.
I'm making no claim about general the memory safety of C++, and its issues are well known.
* Even smart pointers are still pointers, which are trivial to access after release by mistake; and references are only safe as long as the caller still exists. C++ does not have anything like Rust's borrow checker.
* C++ threads allow race conditions that can screw up even smart pointers.
* Plenty of libraries (C and C++), which are usually impossible to avoid and completely impractical to vet, will still use raw pointers.
Generally, the word "trivial" and C++ don't go well together.