4 ms·
Sadly, this actually isn’t true, and can cause some dangling/use-after-free issues. An empty string_view has a length of zero, but it’s representation might con
by rand_flip_bit 4y ago
Sadly, this actually isn’t true, and can cause some dangling/use-after-free issues. An empty string_view has a length of zero, but it’s representation might contain a null/non-null pointer + zero or two pointers that “compare equal”. I put compare equal in quotes because pedantically, after delete/free are called, they will not be required to compare equal.
- mgaunard 4y agoSee https://en.cppreference.com/w/cpp/string/basic_string_view/basic_string_view https://en.cppreference.com/w/cpp/string/basic_string_view/b... overload 1. Also it's "its", not "it's".