3 ms·
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 mor
by 112233 3y ago
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
- another2another 3y agoTo 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.
- sirwhinesalot 3y agostring_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.