News for hackers. Stuff that matters.
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.
Re:Embracing Modern C++ Safely, Book Review by adrianN on Tuesday May 31, 2022 @04:20AM (#31567203)
"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.
Re:Embracing Modern C++ Safely, Book Review by ncmncm on Friday June 03, 2022 @04:46AM (#31605805)
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.