Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2006-05-24 08:01:54


> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Peter Dimov

> You don't have to change the implementation of ->* depending
> on the smart pointer type. *p is always the dereference
> operation, and (proxy references
> notwithstanding) &*p is always a raw pointer to the pointee.
> get() is needed for cases when the source is NULL, but we
> need not worry about them here, as ->* isn't allowed.

Okay.

> So:
>
> template<class P, class M, class C> inline
> typename closure<M C::*>::type operator->*( P p, M C::* member)
> {
> return make_closure( &*p, member );
> }
>
> It would work for iterators, too.

How would this affect generic code? A use of this operator would likely be
dependent and therefore might only be found through the ADL in the second phase.

Regards,
Paul Mensonides


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