
Raoul Gough <yg-boost-users@m.gmane.org> writes:
David Abrahams <dave@boost-consulting.com> writes:
David Abrahams <dave@boost-consulting.com> writes:
We probably ought to define a public referent<T> metafunction in namespace boost which implements that logic, so that people can specialize it.
That's done; the docs still need to be updated to reflect that fact though.
Alright! So I can now specialize boost::referent for my own smart pointer template:
namespace boost { template<class T> struct referent<utils::weak_ptr<T> > { typedef T type; }; }
If neccessary. It usually isn't, though.
Really seems a bit weird that boost::referent wasn't already invented in the type_traits portion of the library, since it can be applied to any kind of pointer, iterator, etc... Anyway, it has neatened up my code quite a bit, thanks.
It's a little quirky, yet. If you define an iterator with a nested element_type member it will do the wrong thing. -- Dave Abrahams Boost Consulting www.boost-consulting.com