On 09/05/12 15:17, Martin Sebor wrote:
On 09/05/2012 12:40 PM, Liviu Nicoara wrote:
On 09/05/12 14:09, Stefan Teleman wrote:
On Wed, Sep 5, 2012 at 10:52 AM, Martin Sebor <mse...@gmail.com> wrote:
[...]
OK so I did a little bit of testing, after looking at the *right*
__rw_guard class. :-)
I changed the std::numpunct class thusly:
[...]
I am afraid this would be unsafe, too (if I said otherwise earlier I was
wrong). [...] Thoughts?
You're right, there's still a problem. We didn't get the double
checked locking quite right.
I wish for simplicity: eliminate the lazy initialization, and fully initialize
the facet in the constructor. Then we'd need no locking on copying its data
(std::string takes care of its own copying).
Liviu