Boost logo

Boost :

Subject: Re: [boost] [container] Implemented Polymorphic Memory Resources
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2015-09-09 04:26:11


On 09.09.2015 08:04, Tim Song wrote:
> On Tue, Sep 8, 2015 at 7:57 AM, Ion Gaztañaga <igaztanaga_at_[hidden]> wrote:
>
>> Good point. The specification says they return:
>>
>> "A pointer to a static-duration object of a type"
>>
>> Both classes are empty but we need to initialize the virtual function
>> pointer. We could make some lazy initialization via placement new as the
>> destructor is trivial and just avoid the explicit placement destruction.
>> Could this be acceptable?
>>
>> Best,
>>
>> Ion
>>
>
> Maybe I'm missing something obvious, but why can't they use function-local
> statics?

1. It is not thread-safe in C++03.
2. It doesn't solve the problem for global destructors. Function-local
static variables can be destroyed before being used in destructors.


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