3 ms·
> The same is probably true for anybody coding C++ using modern library facilities. There is just no temptation to do anything dodgy. std::string_view is but t
by zozbot234 5y ago
> The same is probably true for anybody coding C++ using modern library facilities. There is just no temptation to do anything dodgy.
std::string_view is but the latest example of a "modern" C++ facility that turns out to be a dodgy footgun, due to the lack of safeguards around lifetime errors. C++ still lacks a general equivalent to string_view for arrays (what Rust calls a slice) for the same reason. These seem like significant drawbacks to me.
- 10000truths 5y agoC++ does have this, it’s called std::span. https://en.cppreference.com/w/cpp/container/span https://en.cppreference.com/w/cpp/container/span
- pjmlp 5y agoJust make /analyze part of the compiler options and some of those issues will be visible.