Boost logo

Boost :

Subject: Re: [boost] Proposal: Monotonic Containers
From: Christian Schladetsch (christian.schladetsch_at_[hidden])
Date: 2009-06-16 04:07:40


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.
* Use a single static 'storage'. I hate this the most.

None of these invalidate the library as it stands.

BTW, this has nothing to do with my original code that you quoted where a
vector migrates from the stack to the heap transparently.

> I have a few ideas and might play around with them.

I'm interested in hearing your thoughts on how the larger issue could be
addressed. But as noted, it is not me that is breaking the standard if you
splice between two lists that are using different allocators.

Regards,
Chrisitan.


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