Boost logo

Boost :

Subject: Re: [boost] [sort] [container] Challenge for sorting experts, improved stable sort
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2015-09-23 06:59:18


On Wed, Sep 23, 2015 at 12:29 PM, Ion Gaztañaga <igaztanaga_at_[hidden]> wrote:
> On 22/09/2015 18:41, Phil Endecott wrote:
>
> According to the standard a container should
> allocate all memory from the allocator, I don't know if it should include
> temporary storage, I can't find anything explicit in the standard.
>
> The issue is that we have no STL container that does something similar, it's
> hard to know what a user should expect. In any case, allocating temporary
> storage from the allocator or new/malloc in every range insertion sounds
> like a very good method to fragment memory.

I think it is fair to expect any memory allocations made by container
are done through the allocator, whether these are for temporary use or
not (well, except for exceptions and strings in them). This
expectation is further reinforced with the addition of memory resource
propagation, which allows to use the same allocator for the contained
elements as well.


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