I see this post: c++ - Why doesn't std::string_view have assign() and clear() methods? - Stack Overflow, so string_view
does not contain clear
function.
But in my case, I have a string_view
as a class member variable, and sometimes, I would like to reset it to an empty string. Currently, I'm using this way:
sv = "";
Which looks OK, but I'd see other suggestions, thanks!