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 13 '26
How is cstring_view going to guarantee that it is null terminated if it doesn't create its own buffer? That would be an allocation, this makes absolutely no sense. If you guard it at the construction site then you can do the same with just using string_view, no new type needed.