Difference between revisions of "cpp/locale/wstring convert"
m (Text replace - "{{cpp|" to "{{c|") |
m (Text replace - "{{tdcl list begin" to "{{dcl list begin") |
||
Line 15: | Line 15: | ||
===Member types=== | ===Member types=== | ||
− | {{ | + | {{dcl list begin}} |
{{tdcl list hitem | Member type | Definition}} | {{tdcl list hitem | Member type | Definition}} | ||
{{tdcl list item | {{tt|byte_string}} | {{tt|std::basic_string<char, char_traits<char>, Byte_alloc>}}}} | {{tdcl list item | {{tt|byte_string}} | {{tt|std::basic_string<char, char_traits<char>, Byte_alloc>}}}} |
Revision as of 01:17, 12 June 2012
Template:cpp/locale/wstring convert/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td><locale>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td > class Elem = wchar_t,
class Wide_alloc = std::allocator<Elem>,
class Byte_alloc = std::allocator<char> >
<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end
Class template std::wstring_convert performs conversions between byte string std::string and wide string std::basic_string<Elem>, using an individual code conversion facet Codecvt
. std::wstring_convert assumes ownership of the conversion facet, and cannot use a facet managed by a locale. The standard facets suitable for use with std::wstring_convert are std::codecvt_utf8 for UTF-8/UCS2 and UTF-8/UCS4 conversions and std::codecvt_utf8_utf16 for UTF-8/UTF-16 conversions.