|
|
|
|
|
by 1313ed01
38 days ago
|
|
The problem with C++ string slices is that after many years of C++ becoming increasingly memory-safe with std::string and smart pointers, now we reverted to something barely more safe than a C string. I guess Rust can keep slices safe using some borrow checker magic or something, but C++ can't. |
|
If you keep const pointer to a std::string in C++ in 2016 that's exactly the same danger (of dangling pointers) as for a std::string_view in 2026, there's no change to that part.