Hacker News new | past | comments | ask | show | jobs | submit login

Just to comment on this point:

> Enforcing safety seems like the right call

It certainly is, however it is hard to argue this point while looking at other more or less recent features:

string_view is basically a fancy "char *", with all the same use-after-free issues (same with other pointer range types and iterators)

Lambas with capture-by-reference can be freely copied and type erased into function<>, so obviously they did not care about safety when that feature got included




To really make string_view sane and safe, you'd have to make std::string reference counted (with each string view holding a ref), but I can't see that being popular.


string_view (like span) is meant for spatial memory safety, C++ doesn't help much with temporal memory safety.

That said, span (unlike string_view) fails at its intended purpose, because C++ just loves to be a total clown show.




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

Search: