|
Boost : |
Subject: Re: [boost] Proposal: Monotonic Containers
From: Christopher Jefferson (chris_at_[hidden])
Date: 2009-06-16 05:07:41
On 16 Jun 2009, at 09:07, Christian Schladetsch wrote:
> Hi Ross,
>
> Sorry for my staccato replies. You caught me on the way out the door
> from
> work and I only had time to run some tests and post the results.
>
> In truth, this is a non-issue. The code you presented broke the
> standard;
> monotonic allocator didn't. Allocators are indeed allowed to have
> non-static
> members.
>
> There are various solutions to this 'problem':
>
> * Only use one monotonic::storage. Multiple allocators that use the
> one
> storage will correctly compare as equal and can be shared.
> * Don't use std::list::splice with multiple allocators with GCC.
> * Fix the standard so that all STL implementations must respect
> allocator
> inequality. The fact that they are not required to is an
> anachronism. It is
> certainly possible.
This is not a simple "fix", there are major issues, to do with when,
or how, assignment, construction and swapping move allocators around.
There has been some serious discussion and research on this issue
previously.
Not to say it can't be fixed, but it isn't just a case of "oh yes,
just say they respect it".
Chris
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk