You forgot that beauty - "undefined behavior"!
Memory-safety can guarantee only so much safety! C++ can still blow up in your face, even with all the alleged memory-safety built into C++, thanks to all the UB traps in C and C++.
Rust is the closest language that has no such "gotchas".
I recently got bitten by exactly that
std::optional
UB and here I was thinking ๐ค after 12+ years in the industry starting all the way back in the day with C++03 that modern C++ was supposed to make things better.๐