Boost logo

Boost :

Subject: Re: [boost] [filesystem][v3] Class path codecvt argument now available for appropriate functions
From: Beman Dawes (bdawes_at_[hidden])
Date: 2010-06-24 16:22:26


On Thu, Jun 24, 2010 at 12:31 PM, Stewart, Robert
<Robert.Stewart_at_[hidden]> wrote:
> Beman Dawes wrote:
>>
>> The initial V3 implementation, like V2, could alter the codecvt facet
>> used for conversion via a static imbue() function. This has a number
>> of problems, including:
>>
>> * It is, in effect, a global variable, and thus "considered harmful"
>> as being prone to abuse.
>
> Many things in the standard library can be abused.  That doesn't mean it should be easy or the only way to do a thing, but there is precedent for the inclusion of abuse prone constructs.
>
>> * It is subject to data races in multi-threaded environments.
>
> If an application imbues a codecvt facet in main() before creating threads, is that still an issue?  IOW, can it not be used safely?

AFAIK, there is no problem if the facet is imbued before creating threads.

>> * It can be hard to use.
>>
>> * It can be hard to explain.
>
> No comment.
>
>> As of revision 63283 this morning, V3 class path in trunk now has an
>> additional "const codecvt&" for all functions where conversion may be
>> required.[snip]
>>
>> That's great, but where does that leave path::imbue? I think it should
>> be deprecated. What do others think?
>
> I'd be inclined to leave it for those that always want a single codecvt facet, but I have no horse in this race.

It is still in for the moment. I guess I don't feel strongly about it.

Thanks,

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk