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) {