5 ms·
I think the issue with string_view is less laziness and more recency: most libraries still need to support C++ versions prior to C++17. Rust had the advantage t
by johncolanduoni 5y ago
I think the issue with string_view is less laziness and more recency: most libraries still need to support C++ versions prior to C++17. Rust had the advantage that slices were there from day one.
- pjmlp 5y agoFor example, Bloomberg is still on their transition to C++14, let alone C++17. "C++11/14 at Scale: What Have We Learned?" https://www.youtube.com/watch?v=E3JG2Ijjei4 https://www.youtube.com/watch?v=E3JG2Ijjei4
- ATsch 5y agoI don't think it's just recency either, it's just incredibly easy to shoot yourself into the foot with string_view when the language has no way of checking that the pointed to memory is actually valid. People moved to smart pointers for good reasons and string_view just undoes all of that.
- pjmlp 5y agoYeah, it was a bad decision. While using C++, adding something like gsl to the toolbox is worth gold, and also enabling bounds checking even in release (really, most of the time it hardly matters to the application users).