Boost logo

Boost :

From: Jonathan Graehl (jonathan_at_[hidden])
Date: 2004-09-21 14:30:36


>
>
>Nope, there's only one global locale, it's not per-thread. If it's
>per-thread, you can do
>
> std::locale::tss_global(std::locale("koi8-r"));
> // do some work with program_options
> std::locale::tss_global(std::locale(""));
>

I do this all the time (but using a scope guard), for globals I've
declared thread-local. This essentially simulates dynamic scoping
(which I'd prefer to see supported directly by the language, as an
alternative to lexical scoping). Perhaps a Boost library for
dynamically scoped properties would be nice?

-Jonathan


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