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
As I understand it std::string, std::wstring, std::u16string and std::u32string are mainly intended to store utf-strings.
Since at least utf-8 and utf-16 have variable storage sizes for their code points the question for the "size of a string" storing either encoding is ambiguous:
On one hand there is the storage size of the string, which can be obtained by either std::basic_string::size() or std::basic_string::length().
[Why two methods to get the same result?]
On the other hand the amount of stored code points.
Sadly without a standard way to ask for, or have I missed something?
The text was updated successfully, but these errors were encountered:
As I understand it
std::string
,std::wstring
,std::u16string
andstd::u32string
are mainly intended to store utf-strings.Since at least utf-8 and utf-16 have variable storage sizes for their code points the question for the "size of a string" storing either encoding is ambiguous:
std::basic_string::size()
orstd::basic_string::length()
.[Why two methods to get the same result?]
Sadly without a standard way to ask for, or have I missed something?
The text was updated successfully, but these errors were encountered: