3 ms·
Using string_view in this example doesn't solve the use-after-free bug. If you are concerned about memory safety, the only appropriate choices are to copy the
by seabee 12y ago
Using string_view in this example doesn't solve the use-after-free bug.
If you are concerned about memory safety, the only appropriate choices are to copy the string and have the string_view objects share ownership, or to use the primitive index range idea and punt the problem back to the programmer.
- dbaupp 12y agoYep, definitely, I was just responding to the question of which view-into-a-string type is the most appropriate.