|
Boost : |
From: Lin Xu (risingdragon3_at_[hidden])
Date: 2003-02-14 01:24:55
>I would have expected that for member function pointers arg1_type would be
> typedef cv class_type* arg1_type;
But isn't the class_type pointer hidden? AFAIK, you can't call a member
function pointer as if it's function pointer with an explicit 'this'
parameter. So how is the arg1_type classtype?
But on the other hand, that's what bind does - so you can bind the class
instance to be called..
Really what's better is a mem_fun adaptor - like boost::mem_fun except at
compile time, since the member function pointer is a template parameter.
* template <class PropertyKey, class Functor> function
-> function<print_function, ct_mem_fun<void,A,&A::print> >
That way you could also call nested functors inside the class, which allows
more flexibility.
So disregard that code for extending function_traits to work with member
function pointers =P It wasn't very good anyway.
Lin.
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk