Four adapter is not1, not2, bind1st and bind2nd. It can change you current
functor. An example is below: equal_to is binary function, but count_if
only need unary function. bind1st or bind2nd can change binary function to
unary function. another function is not1, used for unary function, not2 used
for binary function.
In order to use these four adapters. You functor should be inheriated from
unary_funciton or binary_function. It make you function object has
typedef information, which not1 or not2 will use them.
Usage of ptr_fun, If you want to adapter a current function, (not function
object), because function doesn’t have any typedef information, so you have
to use ptr_fun firstly.
With variadic templates, a lot of general function composing can be
expressed much more simply and consistently, so all of the old cruft
is no longer necessary: depracated in C++ 11. (but support) Douse: std::function, std::bind, std::mem_fn, std::result_of,lambdas . Don’t use: std::unary_function, std::binary_functionstd::mem_fun , std::bind1st, std::bind2nd