Adobe Systems Incorporated


Category: functors Component type: type


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 AdaptableUnaryFunction. Specifically, any model of AdaptableUnaryFunction must define nested typedefs. Those typedefs are provided by the base class unary_function.


struct sine : public unary_function<double, double> {
    double operator()(double x) { return sin(x); }


Defined in the standard header functional, and in the nonstandard backward-compatibility header function.h.

Template parameters

Parameter Description Default
Arg The function object's argument type  
Result The function object's result type  

Model of

Assignable, DefaultConstructible

Type requirements

Public base classes



Member Where defined Description
argument_type unary_function See below.
result_type unary_function See below.

New members

These members are not defined in the Assignable and DefaultConstructible requirements, but are specific to unary_function.

Member Description
argument_type The function object's argument type. This is a typedef for the template parameter Arg.
result_type The function object's result type. This is a typedef for the template parameter Result.


See also

The functors overview, AdaptableUnaryFunction, binary_function

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google