Standard C++ Library Class Reference
Function objects that take one argument are called unary function objects. Unary function
objects are required to provide the typedefs argument_type and result_type. Similarly, function
objects that take two arguments are called binary function objects and, as such, are required to
provide the typedefs first_argument_type, second_argument_type, and result_type.
The classes unary_function and binary_function make the task of creating templated function
objects easier. The necessary typedefs for a unary or binary function object are provided by
inheriting from the appropriate function object class.
The function objects provided by the standard library are listed below, together with a brief
description of their operation. This class reference also includes an alphabetic entry for each
function.
Name Operation
arithmetic functions
plus addition x + y
minus subtraction x - y
times multiplication x * y
divides division x / y
modulus remainder x % y
negate negation - x
comparison functions
equal_to equality test x == y
not_equal_to inequality test x != y
greater greater comparison x > y
less less-than comparison x < y
greater_equal greater than or equal comparison x >= y
less_equal less than or equal comparison x <= y
logical functions
logical_and logical conjunction x && y
logical_or logical disjunction x || y
logical_not logical negation ! x