Boost logo

Boost :

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


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.

* It is subject to data races in multi-threaded environments.

* It can be hard to use.

* It can be hard to explain.

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. So you can now write:

    utf8_codecvt_facet utf8; // UTF-8 facet from boost or other sources
    path p(some_string, utf8); // some_string will be treated as UTF-8 encoded

    ... operations on p

That's great, but where does that leave path::imbue? I think it should
be deprecated. What do others think?

--Beman


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