Boost logo

Boost Users :

From: Raoul Gough (yg-boost-users_at_[hidden])
Date: 2003-07-16 15:43:06


David Abrahams <dave_at_[hidden]> writes:

> David Abrahams <dave_at_[hidden]> 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;
  };
}

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.

-- 
Raoul Gough
"Let there be one measure for wine throughout our kingdom, and one
measure for ale, and one measure for corn" - Magna Carta

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net