144 #include <functional>
151 template <
class Ret,
class Arg,
class T>
152 class Functor1:
public std::unary_function<Arg, Ret> {
157 Functor1(T& obj_, Ret (T::*func_)(Arg)): obj(&obj_), func(func_) {}
160 template <
class Ret,
class Arg,
class T>
162 Ret (T::*func)(Arg)) {
168 template <
class Ret,
class Arg,
class T>
171 Ret (T::*func)(Arg)
const;
174 Functor1_const(
const T& obj_, Ret (T::*func_)(Arg)
const): obj(&obj_), func(func_) {}
177 template <
class Ret,
class Arg,
class T>
179 Ret (T::*func)(Arg)
const) {
185 template <
class Ret,
class Arg1,
class Arg2,
class T>
186 class Functor2:
public std::binary_function<Arg1, Arg2, Ret> {
188 Ret (T::*func)(Arg1, Arg2);
190 Ret
operator()(Arg1 arg1, Arg2 arg2)
const {
return (obj->*func)(arg1, arg2);}
191 Functor2(T& obj_, Ret (T::*func_)(Arg1, Arg2)): obj(&obj_), func(func_) {}
194 template <
class Ret,
class Arg1,
class Arg2,
class T>
196 Ret (T::*func)(Arg1, Arg2)) {
202 template <
class Ret,
class Arg1,
class Arg2,
class T>
205 Ret (T::*func)(Arg1, Arg2)
const;
207 Ret
operator()(Arg1 arg1, Arg2 arg2)
const {
return (obj->*func)(arg1, arg2);}
208 Functor2_const(
const T& obj_, Ret (T::*func_)(Arg1, Arg2)
const): obj(&obj_), func(func_) {}
211 template <
class Ret,
class Arg1,
class Arg2,
class T>
213 Ret (T::*func)(Arg1, Arg2)
const) {
Functor2_const(const T &obj_, Ret(T::*func_)(Arg1, Arg2) const)
Definition: mem_fun.h:208
Ret operator()(Arg arg) const
Definition: mem_fun.h:173
Functor1< Ret, Arg, T > make(T &t, Ret(T::*func)(Arg))
Definition: mem_fun.h:161
Ret operator()(Arg1 arg1, Arg2 arg2) const
Definition: mem_fun.h:207
Ret operator()(Arg1 arg1, Arg2 arg2) const
Definition: mem_fun.h:190
Functor1_const(const T &obj_, Ret(T::*func_)(Arg) const)
Definition: mem_fun.h:174
Definition: mem_fun.h:152
Definition: mem_fun.h:203
Ret operator()(Arg arg) const
Definition: mem_fun.h:156
Functor2(T &obj_, Ret(T::*func_)(Arg1, Arg2))
Definition: mem_fun.h:191
Definition: mem_fun.h:169
Definition: mem_fun.h:186
Definition: application.h:44
Functor1(T &obj_, Ret(T::*func_)(Arg))
Definition: mem_fun.h:157