Boost logo

Boost :

Subject: Re: [boost] [ptr_container] new_clone overload
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-08-20 10:10:56


Frank Mori Hess skrev:
> -----BEGIN PGP SIGNED MESSAGE-----
> 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?

Yes, which do you prefer?

> 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 );

-Thorsten


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