
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] 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