Many C++ programmers are familiar with the basics of the <string>
library, particularly the use of std::string
when creating a string in C++. This is definitely an improvement over the old C-style “strings” using null-terminated char arrays. However, the C++ standard libray has introduced more useful components in C++17 and C++20 to help you write more effective code in both the <string>
and <string_view>
library headers.
std::basic_string
In the <string>
header, the std::basic_string
class is a templated class that provides specializations for…