This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD status.

721. wstring_convert inconsistensies

Section: 99 [depr.conversions.string] Status: NAD Submitter: Bo Persson Opened: 2007-08-27 Last modified: 2017-04-22

Priority: Not Prioritized

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

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

View all issues with NAD status.

Discussion:

Paragraph 3 says that the Codecvt template parameter shall meet the requirements of std::codecvt, even though std::codecvt itself cannot be used (because of a protected destructor).

How are we going to explain this code to beginning programmers?

template<class I, class E, class S>
struct codecvt : std::codecvt<I, E, S>
{
    ~codecvt()
    { }
};

void main()
{
    std::wstring_convert<codecvt<wchar_t, char, std::mbstate_t> > compiles_ok;
    
    std::wstring_convert<std::codecvt<wchar_t, char, std::mbstate_t> >   not_ok;
}

[ San Francisco: ]

Bill will propose a resolution.

[ 2009-07 Frankfurt: ]

codecvt isn't intended for beginning programmers. This is a regrettable consequence of the original design of the facet.

Move to NAD.

Proposed resolution: