On 7/27/2015 2:22 PM, Doug Mika wrote:
> the definition of mem_fn goes as follows :
>
> template <class Ret, class T>
> /* unspecified */ mem_fn (Ret T::* pm);
> Convert member function to function object
> Returns a function object whose functional call invokes the member
function pointed by pm.
So, what object does it return? What does its definition look like?
How is *its* operator() implemented? Did you actually look, as I have
suggested, in the headers that came with your compiler?
> The type of the returned object has the following properties:
> Its functional call takes as first argument an object of type T (or
> a
reference or a pointer to it) and, as additional arguments, the
arguments taken by pm (if any). The effect of such a call with fn as
first argument are the same as calling fn.*pm (or (*fn).*pm if fn is a
pointer), forwarding any additional arguments.
?
> If instead I call with fn2 as an argument instead of fn, must fn2
> have a member function pm or simply satisfy that all conditions of
> *pm be met on the object fn2 (that all necessary member variables
> required by *pm exist in fn2)?
I have no idea what you're talking about.