Why should you avoid returning std::string_view to local data?
std::string_view bad() { std::string s="x"; return s; } // dangles- When is returning a string_view safe? | What should you return instead?
11 Strings & string_view interview questions for C++ roles, each with a model answer, examples and likely follow-ups.
11 questionsWhy should you avoid returning std::string_view to local data?
std::string_view bad() { std::string s="x"; return s; } // dangles
Showing 11–11 of 11