To be fair, string_view has one very attractive feature over const ref string. String's char constructor is not explicit. With string view, you are guaranteed to not allocate by accident.
Exactly! When you have a `const std::string&` argument, passing a C-string implicitly allocates a new temporary `std::string`.
`std::string_view` accepts both `const std::string&` and `const char*` without hidden allocations.
Exactly! When you have a `const std::string&` argument, passing a C-string implicitly allocates a new temporary `std::string`.
`std::string_view` accepts both `const std::string&` and `const char*` without hidden allocations.