Ada was a contemporary of C++ which had such memory safety. In fact Ada was first standardized long before C++, so the issue wasn't unknown or even obscure when C++ was being developed.
Moreover, there are no run-time performance issues. Memory safety can be verified at compile time provided things like pointer arithmetic are forbidden.
The problem for C++ is that memory safety and C-style pointer manipulation are incompatible.
C++ was marketed as "C with classes." This was a hugely successful marketing move (it helped C++ beat Ada, for one). It wouldn't have worked if all the C programmers keen on picking up "object orientation" had flipped open their C++ book and found that it had "neutered" their pointers though. They wanted to be "OO compliant" by writing "class" instead of "struct" and change nothing else and C++ promised to deliver that.
Moreover, there are no run-time performance issues. Memory safety can be verified at compile time provided things like pointer arithmetic are forbidden.
The problem for C++ is that memory safety and C-style pointer manipulation are incompatible.
C++ was marketed as "C with classes." This was a hugely successful marketing move (it helped C++ beat Ada, for one). It wouldn't have worked if all the C programmers keen on picking up "object orientation" had flipped open their C++ book and found that it had "neutered" their pointers though. They wanted to be "OO compliant" by writing "class" instead of "struct" and change nothing else and C++ promised to deliver that.