Subject: Re: [boost] [ptr_container] new_clone overload
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-08-20 17:11:35
Frank Mori Hess skrev:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> On Thursday 20 August 2009, Thorsten Ottosen wrote:
>> Frank Mori Hess skrev:
>>> I've noticed that ptr_container/clone_allocator.hpp contains an
>>> undocumented overload of new_clone that accepts a pointer-to-const:
>>> template< class T >
>>> inline T* new_clone( const T* r );
>>> It is annoying because it doesn't support a pointer-to-non-const
>>> argument, resulting in a compile error if you try. Any chance one of the
>>> following could be done?
>> Yes, which do you prefer?
> 1,2, or 4 are all equally fine to me. Actually, I'm currently in the process
> of moving away from new_clone to a "placement" version of it for
> generic_ptr::cloning (a cloning smart pointer class). That will let me avoid
> having to do two allocations for every copy of generic_ptr::cloning, by using
> a boost::aligned_storage inside the clone allocator. Also, my versions of
> new_clone and CloneAllocator will have to be generalized slightly to support
> generic pointer-like objects in addition to plain old pointers.
>>> 1) remove it
Seems like 1 is the simplest then.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk