Improved string handling in C++20

CMP
3 min readNov 20, 2023

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…

--

--

CMP

Software engineer specializing in operating systems, navigating the intracicies of the C++ language and systems programming.