|
unary_functionclass template
<functional> template <class Arg, class Result> struct unary_function; Unary function object base class This is a base class for standard unary function objects.Generically, function objects are instances of a class with member function operator() defined. This member function allows the object to be used with the same syntax as a regular function call, and therefore it can be used in templates instead of a pointer to a function. In the case of unary function objects, this operator() member function takes one single parameter. unary_function is just a base class, from which specific unary function objects are derived. It has no operator() member defined (derived classes are expected to define this) - it simply has two public data members that are typedefs of the template parameters. It is defined as:
Members
Example
Possible output:
See also
|