Boost logo

Boost :

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


>
>> There's a problem with using an allocator for the node based containers:
>> they
>> use the allocator to allocate the elements but not the nodes. That
>> implies
>> free store (de)allocations for the nodes which is contrary to the intended
>> purpose of this proposal.
>>
>>
>
> Umm, I beg to differ. If we have a node-based container
>
> xxx<T,...,custom_allocator<T> >

Right. Furthermore, if the node structure is (roughly):

template <typename T>
struct node {
  T data;
  node *prev, *next;
};

How would you separate the allocation of node<T> and node<T>.data?

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