I am wondering what is the practical usage of unary_function? Could anyone list some practical benefits?
My question is, a class like
class Foo : public std::unary_function<class A, class B>
is always the same (could use similar implementation) to
template <class A, class B> class Foo
So we could always use the alternative approach to replace unary_function.
thanks in advance,
All unary_function does is add the result_type and argument_type (might be mistaken about the names) typedefs to your functor. You can always replace unary_function by simply doing this yourself.
These typedefs are needed by the standard functor adapters.