Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Use string_view, but beware of use-after-free bugs like https://github.com/isocpp/CppCoreGuidelines/issues/1038


Think of string_view as a non-owning pointer to a known-size array. If the array is moved or destroyed, then string_view is left dangling... just like a pointer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: