You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with C++11, we have a full range of specialized string classes... E.g., std::u8string, std::u16string... std::u8string_view, and so forth. Strictly speaking they were introduced with C++11 (for std::*string) and C++17 (for std::*string_view) but std::u8string became available with C++20.
We could use std::string, assuming that it is UTF-8, but it might also use other encodings. If we are explicit that we are assuming UTF-8 then it is ok.
What we could do is to provide conversion functions. That might be helpful to some...?
The objective would be to improve quality of life for users who prefer not to mess with pointers.
I'm guessing we also want to provide a std::ranges-based API with lazy evaluation. For instance, assuming a compiler that encodes string literals as UTF-8, we want the following to work:
Starting with C++11, we have a full range of specialized string classes... E.g., std::u8string, std::u16string... std::u8string_view, and so forth. Strictly speaking they were introduced with C++11 (for std::*string) and C++17 (for std::*string_view) but std::u8string became available with C++20.
We could use std::string, assuming that it is UTF-8, but it might also use other encodings. If we are explicit that we are assuming UTF-8 then it is ok.
What we could do is to provide conversion functions. That might be helpful to some...?
The objective would be to improve quality of life for users who prefer not to mess with pointers.
References:
https://en.cppreference.com/w/cpp/string/basic_string_view
https://en.cppreference.com/w/cpp/string/basic_string
The text was updated successfully, but these errors were encountered: