3 ms·
I don’t have a modern implementation handy, but according to https://en.cppreference.com/w/cpp/string/basic_string_view/data https://en.cppreference.com/w/cpp/s
by erik_seaberg 3y ago
I don’t have a modern implementation handy, but according to https://en.cppreference.com/w/cpp/string/basic_string_view/data https://en.cppreference.com/w/cpp/string/basic_string_view/d... a string_view depends on its data() pointer, and the lifetime of that buffer doesn’t seem to have guarantees.
- angiosperm 3y agoThus, the word "view". It refers to storage being managed by the creator of the string_view object, in this case a file mapped using mmap and not unmapped until after program termination.