r/cpp • u/pavel_v • Apr 30 '26
C++26: string and string_view improvements
https://www.sandordargo.com/blog/2026/04/29/cpp26-string-string_view-improvements
70
Upvotes
r/cpp • u/pavel_v • Apr 30 '26
View all comments
Show parent comment
2
u/Zeh_Matt No, no, no, no May 07 '26
How would that even work? A string view is nothing more than a pointer + size, it does not own the memory so it's not allowed to mutate it and if you create a separate buffer in the string_view then it kills the purpose of string_view at this point you could just do std::string{ view }