<string>, typedefs<string> typedefs
stringstring | u16stringu16string | u32stringu32string |
wstringwstring |
stringstring
Type qui décrit une spécialisation du modèle de classe basic_string avec des éléments de type char.A type that describes a specialization of the class template basic_string with elements of type char.
Les autres typedefs spécialisés pour basic_string
sont wstring, u16string et u32string.Other typedefs that specialize basic_string
include wstring, u16string, and u32string.
typedef basic_string<char, char_traits<char>, allocator<char>> string;
NotesRemarks
Les lignes de code suivantes sont des déclarations équivalentes :The following are equivalent declarations:
string str("");
basic_string<char> str("");
Pour obtenir la liste des constructeurs de chaînes, consultez basic_string::basic_string.For a list of string constructors, see basic_string::basic_string.
u16stringu16string
Type qui décrit une spécialisation du modèle de classe basic_string avec des éléments de type char16_t
.A type that describes a specialization of the class template basic_string with elements of type char16_t
.
Les autres typedefs spécialisés pour basic_string
sont wstring, string et u32string.Other typedefs that specialize basic_string
include wstring, string, and u32string.
typedef basic_string<char16_t, char_traits<char16_t>, allocator<char16_t>> u16string;
NotesRemarks
Pour obtenir la liste des constructeurs de chaînes, consultez basic_string::basic_string.For a list of string constructors, see basic_string::basic_string.
u32stringu32string
Type qui décrit une spécialisation du modèle de classe basic_string avec des éléments de type char32_t
.A type that describes a specialization of the class template basic_string with elements of type char32_t
.
Les autres typedefs spécialisés pour basic_string
sont string, u16string et wstring.Other typedefs that specialize basic_string
include string, u16string, and wstring.
typedef basic_string<char32_t, char_traits<char32_t>, allocator<char32_t>> u32string;
NotesRemarks
Pour obtenir la liste des constructeurs de chaînes, consultez basic_string::basic_string.For a list of string constructors, see basic_string::basic_string.
wstringwstring
Type qui décrit une spécialisation du modèle de classe basic_string avec des éléments de type wchar_t.A type that describes a specialization of the class template basic_string with elements of type wchar_t.
Les autres typedefs spécialisés pour basic_string
sont string, u16string et u32string.Other typedefs that specialize basic_string
include string, u16string, and u32string.
typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t>> wstring;
NotesRemarks
Les lignes de code suivantes sont des déclarations équivalentes :The following are equivalent declarations:
wstring wstr(L"");
basic_string<wchar_t> wstr(L"");
Pour obtenir la liste des constructeurs de chaînes, consultez basic_string::basic_string.For a list of string constructors, see basic_string::basic_string.
Notes
La taille de wchar_t est définie par l’implémentation.The size of wchar_t is implementation-defined. Si votre code dépend de wchar_t pour avoir une certaine taille, vérifiez l’implémentation de votre plateforme (par exemple, avec sizeof(wchar_t)
).If your code depends on wchar_t to be a certain size, check your platform's implementation (for example, with sizeof(wchar_t)
). Si vous avez besoin d’un type de chaîne de caractères dont la largeur reste identique sur toutes les plateformes, utilisez string, u16string ou u32string.If you need a string character type with a width that is guaranteed to remain the same on all platforms, use string, u16string, or u32string.
Voir aussiSee also
Commentaires
Chargement du commentaire...