Boost logo

Boost :

Subject: Re: [boost] [ptr_container] new_clone overload
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-08-04 05:03:50

Frank Mori Hess skrev:
> Hash: SHA1
> 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?
> 1) remove it
> 2) add a pointer-to-non-const overload
> 3) change it to
> template< class T >
> T* new_clone( T* r );
> 4) or if you care about always returning a pointer-to-non-const change it to
> template< class T >
> typename remove_const<T>::type * new_clone( T* r );

I really don't see the problem, but removing it entirely is certainly an

Why do you get a compile error? Cloning is not supposed to require a
mutable object. Is your problem with legacy code?


Boost list run by bdawes at, gregod at, cpdaniel at, john at