Boost logo

Boost :

Subject: Re: [boost] Proposal: Monotonic Containers
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-06-09 10:33:32


> > How would you separate the allocation of node<T> and node<T>.data?
>
> template <typename T>
> struct node
> {
> T * data;
> node * prev;
> node * next;
> };

Even with yours, custom_allocator<T> is not the same as
> custom_allocator<node<T>>.
>

If you were going to design your list to require extra allocation and
indirection, sure. Since (I believe that) none of the node-based structures
in the std namespace directly allocate objects of type T, it's kind of a
moot point.

I think this discussion really gets to the heart of the complexity of
allocation strategies for data structures that require nested, multi-type
allocations. As this problem exists for all allocator types, I think it's
way out of the scope of whether or not Christian should be duplicating all
of the containers or simply introducing a new allocator type.

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