result_typefrom the base classes
binary_function). Sometimes those typedefs are required, not just optional.
Adaptors are provided to turn pointers to unary (single-argument) and binary (double-argument) functions into function objects. The long-winded functor
pointer_to_unary_function is constructed with a function pointer
f, and its
operator() called with argument
f(x). The functor
pointer_to_binary_function does the same thing, but with a double-argument
ptr_fun takes a pointer-to-function
f and constructs an instance of the appropriate functor.
|pointer_to_binary_function<_Arg1, _Arg2, _Result> std::ptr_fun||(||_Result(*)(_Arg1, _Arg2)||__x||)||
|pointer_to_unary_function<_Arg, _Result> std::ptr_fun||(||_Result(*)(_Arg)||__x||)||