cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : Miscellaneous : functional : mem_fun_t
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
Miscellaneous
functional
iterator
memory
utility
functional
binary_function
unary_function
operator classes:
· divides
· equal_to
· greater
· greater_equal
· less
· less_equal
· logical_and
· logical_not
· logical_or
· minus
· modulus
· multiplies
· negate
· not_equal_to
· plus
adaptor functions:
· bind1st
· bind2nd
· mem_fun
· mem_fun_ref
· not1
· not2
· ptr_fun
types:
· binary_negate
· binder1st
· binder2nd
· const_mem_fun1_ref_t
· const_mem_fun1_t
· const_mem_fun_ref_t
· const_mem_fun_t
· mem_fun1_ref_t
· mem_fun1_t
· mem_fun_ref_t
· mem_fun_t
· pointer_to_binary_funct...
· pointer_to_unary_function
· unary_negate

-

mem_fun_t class template
template <class S, class T> class mem_fun_t;
<functional>

Generate function object class from parameterless member (pointer version)

Generates an unary function object class from a parameterless member of class T that returns a value of type S.

mem_fun_t is generally used as a type. The function mem_fun (also defined in header <functional>) can be used to directly construct an object of this type.

This class is derived from unary_function and is typically defined as:

template <class S, class T>
  class mem_fun_t : public unary_function <T*,S>
{
  S (T::*pmem)();
public:
  explicit mem_fun_t ( Result (T::*p)() ) : pmem (p) {}
  S operator() (T* p) const
    { return (p->*pmem)(); }
};

Members

constructor
Constructs an unary function object class from member function p of class T. The return type of this member function shall be type compatible with type S.
S operator() (T* p) const
Member function taking one parameter. The argument expected for it is a pointer to an object of type T whose member is to be called.

See also

mem_fun Convert member function to function object (pointer version) (function template)
mem_fun1_t Generate function object class from single-parameter member (pointer version) (class template)
unary_function Unary function object base class (class template)

Home page | Privacy policy
© cplusplus.com, 2000-2008 - All rights reserved - v2.2
Spotted an error? contact us