991. Provide allocator for wstring_convert

Section: D.23.2 [depr.conversions.string] Status: C++11 Submitter: P.J. Plauger Opened: 2009-03-03 Last modified: 2017-04-22 20:23:31 UTC

Priority: Not Prioritized

View other active issues in [depr.conversions.string].

View all other issues in [depr.conversions.string].

View all issues with C++11 status.


Addresses JP-50 [CD1]

Add custom allocator parameter to wstring_convert, since we cannot allocate memory for strings from a custom allocator.

[ Batavia (2009-05): ]

We agree with the proposed resolution. Move to Tentatively Ready.

Proposed resolution:

Change [conversions.string]:

template<class Codecvt, class Elem = wchar_t,
         class Wide_alloc = std::allocator<Elem>,
         class Byte_alloc = std::allocator<char> > class wstring_convert {
    typedef std::basic_string<char, char_traits<char>, Byte_alloc> byte_string;
    typedef std::basic_string<Elem, char_traits<Elem>, Wide_alloc> wide_string;

Change [conversions.string], p3:

-3- The class template describes an ob ject that controls conversions between wide string ob jects of class std::basic_string<Elem, char_traits<Elem>, Wide_alloc> and byte string objects of class std::basic_string<char, char_traits<char>, Byte_alloc> (also known as std::string).