remove_pointer and smart pointers

Hi, I need some kind of traits for my indirect_fun class if it should be usable with smart pointers. I imagined some like template< class T > struct pointer_value { typedef BOOST_DEDUCED_TYPENAME remove_pointer<T>::type type; }; template< class T, class D > struct pointer_value< shared_ptr<T,D> > { typedef T type; }; etc. Any thoughts? Thanks -Thorsten -- Thorsten Ottosen ---------------------------- www.dezide.com www.cs.aau.dk/index2.php?content=Research/bss www.boost.org www.open-std.org/JTC1/SC22/WG21/

Thorsten Ottosen wrote:
Hi,
I need some kind of traits for my indirect_fun class if it should be usable with smart pointers.
I imagined some like
template< class T > struct pointer_value { typedef BOOST_DEDUCED_TYPENAME remove_pointer<T>::type type; };
template< class T, class D > struct pointer_value< shared_ptr<T,D> > { typedef T type; };
etc.
Any thoughts?
<boost/pointee.hpp>, one of the many undocumented Boost headers. :-)

On Sun, 20 Mar 2005 15:41:54 +0200, Peter Dimov <pdimov@mmltd.net> wrote:
<boost/pointee.hpp>, one of the many undocumented Boost headers. :-)
Please correct me if I'm wrong: what is <http://www.boost.org/libs/iterator/doc/pointee.html> if not the documentation for pointee.hpp? Regards, Rogier

Rogier van Dalen wrote:
On Sun, 20 Mar 2005 15:41:54 +0200, Peter Dimov <pdimov@mmltd.net> wrote:
<boost/pointee.hpp>, one of the many undocumented Boost headers. :-)
Please correct me if I'm wrong: what is <http://www.boost.org/libs/iterator/doc/pointee.html> if not the documentation for pointee.hpp?
You are obviously correct and I'm wrong. I've added a link to this page in the two headers, so that I can be less wrong in the future. This has the drawback of making it easier for people to locate the documentation, but we all need to make compromises from time to time. ;-)
participants (3)
-
Peter Dimov
-
Rogier van Dalen
-
Thorsten Ottosen