Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-03-22 11:14:32


The biggest problem here is that you have to know not only the arity but
the argument and return types for the member function. That tends to
limit applicability of the technique.

-Dave

----- Original Message -----
From: "Aleksey Gurtovoy" <agurtovoy_at_[hidden]>

> Jason Shirk wrote:
> > I don't think this would be conforming, defaults are not part of the
> > function type, so the rules of 14.8.2/2 don't help.
> >
> > But if you used something like:
> >
> > template < typename T, void (T::*)() > struct ptmf_helper {};
> >
> > template< typename T >
> > yes_tag has_member_foo_helper(int, ptmf_helper<T, &T::foo>* p = 0);
> >
> > Then I think this could work.
>
> It works! (with Comeau C/C++ 4.2.45.2, and as far as I can see it's
> well-formed):

...


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