7 points nablags 2 hours ago 2 comments

stefanos82 2 hours ago | parent

With GCC and `-fsanitize=address,undefined` flag(s) I have catched it during runtime.

I've got a nice `==31604==ERROR: AddressSanitizer: stack-use-after-scope on address`

quuxplusone 6 minutes ago | parent

This is why I call string_view a "parameter-only type": it's fine to take as a parameter, but not fine to return or to store as a variable. (For sane definitions of "fine" and "not fine," of course. The blog post demonstrates one way it can go "not fine.")

https://quuxplusone.github.io/blog/2018/03/27/string-view-is...