8 Sep
2015
8 Sep
'15
11:57 a.m.
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