Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-01-20 05:17:11


Scott McMurray skrev:
> On 19/01/2008, Robert Dailey <rcdailey_at_[hidden]> wrote:
>> Thanks, I'll look into that and see if it works. However, I like the method
>> I proposed in my first email better. Is there a reason why it could not be
>> done this way? It seems more intuitive and simple. In addition, you wouldn't
>> need to rely on ADL.
>>
>
> Your idea is basically the same as specifying a clone allocator. The
> only difference is that the clone allocator needs to know how to
> allocate objects, not just deallocate them, since you can
> v.push_back(4) into a ptr_vector<int> v.

That is not correct. That syntax was part of the review version, but not
  the final interface. You would have to do

v.push_back( new int(4) );

Also, you don't have to rely on ADL at all. The Cloable Concept relies
on ADL, but the CloneAllocator concept does not. So implement your own
CloneAllocator thereby also specifying how you want to delete objects.

-Thorsten


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