description | title | ms.date | f1_keywords | ||||
---|---|---|---|---|---|---|---|
Learn more about: <string_view> typedefs |
<string_view> typedefs |
04/19/2019 |
|
string_view
u16string_view
u32string_view
wstring_view
A type that describes a specialization of the class template basic_string_view with elements of type char
.
typedef basic_string_view<char, char_traits<char>> string_view;
The following are equivalent declarations:
string_view str("Hello");
basic_string_view<char> str("Hello");
For a list of string constructors, see basic_string::basic_string.
A type that describes a specialization of the class template basic_string_view with elements of type char16_t
.
typedef basic_string_view<char16_t, char_traits<char16_t>> u16string_view;
For a list of string constructors, see basic_string::basic_string.
A type that describes a specialization of the class template basic_string_view with elements of type char32_t
.
typedef basic_string_view<char32_t, char_traits<char32_t>> u32string_view;
For a list of string constructors, see basic_string::basic_string.
A type that describes a specialization of the class template basic_string_view with elements of type wchar_t
.
typedef basic_string_view<wchar_t, char_traits<wchar_t>> wstring_view;
The following are equivalent declarations:
wstring_view wstr(L"Hello");
basic_string_view<wchar_t> wstr(L"Hello");
For a list of string constructors, see basic_string::basic_string.
Note
The size of wchar_t
is two bytes on Windows but this is not necessarily the case for all platforms. If you need a string_view wide character type with a width that is guaranteed to remain the same on all platforms, use u16string_view or u32string_view.