dynamic scoping emulation - was Re: Lexical cast suggestion

21 Sep
2004
21 Sep
'04
7:30 p.m.
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
7568
Age (days ago)
7568
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jonathan Graehl