----- Original Message -----
From: "Daniel Frey" <[EMAIL PROTECTED]>

> This not only leads to safer class detection, it also allows us to
> implement is_member_function without providing versions for every number
> of parameters.

This is already possible.  The specialization...

R C::*

...matches all pointers-to-members, including pointers-to-member-functions.
However, when it *does* match a pointer-to-member-function, the type of 'R' is a
function type.  Therefore, it is possible to detect a pointer-to-member-function
like this:

template<class> struct is_pointer_to_member_function {
    enum { value = false };
};

template<class R, class C> struct is_pointer_to_member_function<R C::*> {
    enum { value = is_same<void (R), void (R*)>::value };
};

...since only function types are implicitly adjusted to pointer-to-function when
used as a parameter.

Regards,
Paul Mensonides

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to