man Member_ptr_functors (Fonctions bibliothèques) -

NAME

Adaptors for pointers to members -

Classes

class std::mem_fun_t< Ret, Type >

One of the adaptors for member pointers. class std::const_mem_fun_t< Ret, Type >

One of the adaptors for member pointers. class std::mem_fun_ref_t< Ret, Type >

One of the adaptors for member pointers. class std::const_mem_fun_ref_t< Ret, Type >

One of the adaptors for member pointers. class std::mem_fun1_t< Ret, Type, Arg >

One of the adaptors for member pointers. class std::const_mem_fun1_t< Ret, Type, Arg >

One of the adaptors for member pointers. class std::mem_fun1_ref_t< Ret, Type, Arg >

One of the adaptors for member pointers. class std::const_mem_fun1_ref_t< Ret, Type, Arg >

One of the adaptors for member pointers. class std::mem_fun_t< void, Type >

One of the adaptors for member pointers. class std::const_mem_fun_t< void, Type >

One of the adaptors for member pointers. class std::mem_fun_ref_t< void, Type >

One of the adaptors for member pointers. class std::const_mem_fun_ref_t< void, Type >

One of the adaptors for member pointers. class std::mem_fun1_t< void, Type, Arg >

One of the adaptors for member pointers. class std::const_mem_fun1_t< void, Type, Arg >

One of the adaptors for member pointers. class std::mem_fun1_ref_t< void, Type, Arg >

One of the adaptors for member pointers. class std::const_mem_fun1_ref_t< void, Type, Arg >

One of the adaptors for member pointers.

Functions

template<class Ret, class Type> mem_fun_t< Ret, Type > std::mem_fun (Ret(Type::*__f)())

template<class Ret, class Type> mem_fun_ref_t< Ret, Type > std::mem_fun_ref (Ret(Type::*__f)())

template<class Ret, class Type, class Arg> mem_fun1_t< Ret, Type, Arg > std::mem_fun (Ret(Type::*__f)(Arg))

template<class Ret, class Type, class Arg> mem_fun1_ref_t< Ret, Type, Arg > std::mem_fun_ref (Ret(Type::*__f)(Arg))

Detailed Description

There are a total of 16 = 2^4 function objects in this family. (1) Member functions taking no arguments vs member functions taking one argument. (2) Call through pointer vs call through reference. (3) Member function with void return type vs member function with non-void return type. (4) Const vs non-const member function.

Note that choice (3) is nothing more than a workaround: according to the draft, compilers should handle void and non-void the same way. This feature is not yet widely implemented, though. You can only use member functions returning void if your compiler supports partial specialization.

All of this complexity is in the function objects themselves. You can ignore it by using the helper function mem_fun and mem_fun_ref, which create whichever type of adaptor is appropriate.