Unary_function is an empty base class: it contains no member
functions or member variables, but only type information. The
only reason it exists is to make it more convenient to define
types that are models of the concept Adaptable Unary Function.
Specifically, any model of Adaptable Unary Function must define
nested typedefs. Those typedefs are provided by the base
class unary_function.
Example
struct sine : public unary_function<double, double> {
double operator()(double x) { return sin(x); }
};
Definition
Defined in the standard header functional, and in the nonstandard
backward-compatibility header function.h.