Boost logo

Boost :

Subject: Re: [boost] [any] new version
From: Ilya Bobir (ilya.bobir_at_[hidden])
Date: 2011-09-02 12:01:53


On Fri, Sep 2, 2011 at 7:28 AM, Artyom Beilis <artyomtnk_at_[hidden]> wrote:
>> From: Martin Bidlingmaier <Martin.Bidlingmaier_at_[hidden]>
>>
>> I've written a new version of boost::any. It does not
>> depend on rtti and uses a static integer value instead of
>> std::type_info to store type information.
>
>
> Please don't do this!
>
> unsigned int next_id()
> {
>    static unsigned int previous_id = 0;   //0 is not assigned to a type
>
>    ++previous_id;
>    return previous_id;
> }
>
> [...]

Would not this be non-thread safe?


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