[RFC] A QoI problem with filebuf and POD charT != char, wchar_t

Martin Sebor sebor@roguewave.com
Wed May 19 19:53:00 GMT 2004


Paolo Carlini wrote:

> Pétur Runólfsson wrote:
> 
>> The standard says that codecvt must be obtained "as if" by:
>>
>>  codecvt<charT,char,typename traits::state_type> a_codecvt =
>>    use_facet<codecvt<charT,char,typename traits::state_type> >(getloc());
>>  
>>
> I see... 27.8.1.1, p5.
> 

Realistically, I don't think anyone relies on it. I doubt that
even test suites exercise this requirement.

> Too bad that because of that, a codecvt facet must *always* be present, 
> even
> when a reasonable behavior would be otherwise perfectly possible:

But what would it be useful for? If you don't narrow down the wide
characters, how do you stream them out? As raw bytes? You'd wind
up with non-portable binary junk in the file.

Martin



More information about the Libstdc++ mailing list