Re:Embracing Modern C++ Safely, Book Review
by ncmncm on Tuesday May 31, 2022 @02:50AM
(#31566759)
The Chrome team is evidently not writing modern C++ code.
[ Parent
| on HN ]
"No true Scotsman...". Take string_view for example: perfectly cromulent modern C++. I use it daily to reduce the number of unnecessary copies. It's also very easy to code a use-after-free bug with it.
Only by storing it somewhere. So long as it is only passed down a call chain, no problem.
string_view really is no different from a naked pointer. Modern C++ treats naked pointers with well-deserved suspicion. I never have any trouble because pointers are always strictly evanescent values.