Boost logo

Boost :

From: Douglas Paul Gregor (gregod_at_[hidden])
Date: 2003-12-04 14:37:58


On Thu, 4 Dec 2003, Thomas Wenisch wrote:
> Does anyone have an implementation of boost::function_traits<T> where T
> is a member function pointer? I want to extract the arity and argument
> types for member function pointers. From the docs and my (brief) testing,
> boost::function_triats<> works only if T is a function type.
>
> Alternatively, is there a way to write a metafunction which takes a single
> parameter and can go from a member function pointer type of the form:
>
> R (T::*)(A1, A2)
>
> To a function type:
>
> R (T *, A1, A2)

Sure, I just don't know how to name it. remove_class seems like an odd
name, so:

template<typename> struct remove_member;

template<typename Class, typename T>
  struct remove_member<T Class::*>
  {
    typedef T type;
  };

        Doug


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