I am learning c++17, I found std::string_view is a new keyword, which can improve std::string performance.
It can avoid copy, according to my understanding.
I have a lot of function, which return std::string, like this:
std::string handle_str(const std::string& s) {
// hanlde
}
will it be good if i just replace with:
std::string_view handle_str(const std::string_view& s) {
// hanlde
}
will this cause crash? and will it improve performance for free?