142 #include <functional>
149 template <
class Ret,
class Arg,
class T>
150 class Functor1:
public std::unary_function<Arg, Ret> {
155 Functor1(T& obj_, Ret (T::*func_)(Arg)): obj(&obj_), func(func_) {}
158 template <
class Ret,
class Arg,
class T>
160 Ret (T::*func)(Arg)) {
166 template <
class Ret,
class Arg,
class T>
169 Ret (T::*func)(Arg)
const;
172 Functor1_const(
const T& obj_, Ret (T::*func_)(Arg)
const): obj(&obj_), func(func_) {}
175 template <
class Ret,
class Arg,
class T>
177 Ret (T::*func)(Arg)
const) {
183 template <
class Ret,
class Arg1,
class Arg2,
class T>
184 class Functor2:
public std::binary_function<Arg1, Arg2, Ret> {
186 Ret (T::*func)(Arg1, Arg2);
188 Ret
operator()(Arg1 arg1, Arg2 arg2)
const {
return (obj->*func)(arg1, arg2);}
189 Functor2(T& obj_, Ret (T::*func_)(Arg1, Arg2)): obj(&obj_), func(func_) {}
192 template <
class Ret,
class Arg1,
class Arg2,
class T>
194 Ret (T::*func)(Arg1, Arg2)) {
200 template <
class Ret,
class Arg1,
class Arg2,
class T>
203 Ret (T::*func)(Arg1, Arg2)
const;
205 Ret
operator()(Arg1 arg1, Arg2 arg2)
const {
return (obj->*func)(arg1, arg2);}
206 Functor2_const(
const T& obj_, Ret (T::*func_)(Arg1, Arg2)
const): obj(&obj_), func(func_) {}
209 template <
class Ret,
class Arg1,
class Arg2,
class T>
211 Ret (T::*func)(Arg1, Arg2)
const) {