Boost logo

Boost :

Subject: Re: [boost] [filesystem][v3] Class path codecvt argument now available for appropriate functions
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2010-06-24 12:31:02


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?

> * 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.

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


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