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 08:32:48


On Wed, Sep 23, 2015 at 2:36 PM, Ion Gaztañaga <igaztanaga_at_[hidden]> wrote:
> On 23/09/2015 12:59, Andrey Semashev wrote:
>
>> 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.
>
> This sounds reasonable. So in your opinion, get_temporary_storage() should
> be avoided?

Yes, I think so.

Yet another reason to always rely on the allocator is that the user
can supply his own allocator with special error reporting method (e.g.
by throwing an application-specific exception instead of bad_alloc).
The application may be expecting that the container will always report
memory allocation errors in this special way.


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