Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Instead, modern C++ code traffics in value types, and relies on destructors, almost always from a library or compiler-generated, for cleanup.

Are std::vector and std::string "value types"?

> Use-after-free never happens

Yes, it does.

> The reason that, in modern C++, memory safety issues fade into insignificance

No, they don't.



std::vector and std::string were designed in the '90s, and came with C++98. They have been modernized, somewhat, with move constructors and the like, but in answer to your implied question, no, they are not modern designs, and they still have sharp edges. That is a burden of backward compatibility.

But you knew they came from C++98. Maybe you meant to ask if I still use them? I do. But I don't store references to their elements.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: