|
Boost : |
Subject: Re: [boost] Proposal: Monotonic Containers
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-06-09 16:29:14
> Chris, it clearly states in your paper that you referenced, in section 4.1,
>> that he is assuming the erasure of the equal-allocator assumption.
>> Checking
>> the C++ standard, section 20.1.6, you will quickly see that the
>> equal-allocator assumption is still in place under the current standard.
>> Thus the techniques mentioned in that paper are non-portable. I will be
>> the
>> first to say that this is stupid and makes lots of problems, but it is
>> there
>> and there's nothing we can do.
>
>
But looking forward, the draft's std:Allocator concept makes no such
requirements - only that allocators are equality comparable. There also
seems to be a number of questions about what happens when you copy or move
an allocator, which implies to me that stateless allocators are no longer
required to be the norm.
But that's looking forward, not necessarily what's portable now.
True, but that paper seriously breaks things anyway -- it adds more methods
> to allocator (via a versioning method) which must then be used by the
> containers to get any benefit. By the time you have required those
> non-standards things, it's probably not unreasonable to also require proper
> support for stateful allocators.
Good points. Maybe it's time to start drafting a Boost.Allocator library
with advanced allocator concepts :)
Andrew Sutton
andrew.n.sutton_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk