Risks Using string_view
Let's look at some cases where string_view may cause problems.
We'll cover the following...
std::string_view
was added into the Standard mostly to allow performance optimizations. Nevertheless, it’s not a replacement for strings! That’s why when you use views you have to remember about a few potentially risky things:
Taking Care of Not Null-Terminated Strings
string_view
may ...