3 ms·
Memory safety in C++ would be easy if everyone everywhere used std::vector.at(), avoided all manual memory management, only used safe libraries, and enabled the
by gary_0 3y ago
Memory safety in C++ would be easy if everyone everywhere used std::vector.at(), avoided all manual memory management, only used safe libraries, and enabled the tooling that fails builds if any C-isms (like implicit casts) are used. That's never going to happen, though.
Modern C++ does give you some nice foot armor, but (and I say this as a grudging C++ developer) that's no match for Rust's policy of taking away your footgun by default.
- olliej 3y agoAnd also don’t use “modern” features like string_view that are memory unsafe by _design_.