Boost logo

Boost :

Subject: Re: [boost] [fusion] sequence io manipulators
From: Jeff Flinn (Jeffrey.Flinn_at_[hidden])
Date: 2013-03-27 09:03:23


On 3/26/2013 4:01 PM, Eric Niebler wrote:
> On 13-03-26 10:46 AM, Steven Watanabe wrote:
>> AMDG
>>
>> On 03/26/2013 10:03 AM, Jeff Flinn wrote:
>>>
>>> I have not addressed possible issues with "static int index =
>>> std::ios::xalloc();" thread safety. gcc at least appears to guard this
>>> initialization with a mutex. I'm not sure what the standard guarantees
>>> in this regard pre/post C++11. Comments would be appreciated.
>>
>> C++11 guarantees that function statics are
>> thread safe. C++03 doesn't.
>
> Right. And IIRC, different versions of different compilers implemented
> that C++11 feature at different times, so it can't really be relied on
> in portable code. Yet.

I checked and found fusion, tuple, locale libs all obtain an index from
xalloc using local static initialization.

chrono and units libs use class static member initialization. I'll
prepare a patch to update fusion you use this latter initialization.

Jeff


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