Boost logo

Boost :

Subject: Re: [boost] [container] Implemented Polymorphic Memory Resources
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2015-09-08 07:57:01


On 08/09/2015 13:26, Andrey Semashev wrote:
> I see that new_delete_resource and null_memory_resource instances have
> static storage duration. I suppose, it means that containers using these
> resources cannot be used in global constructors/destructors (including
> the global variables of their type)? This is a serious limitation IMO,
> as people often use strings and containers globally.

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


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