Standard C++ Library Class Reference
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
Function Objects
Summary
Objects with an operator() defined. Function objects are used in place of pointers to functions as
arguments to templated algorithms.
Contents
Synopsis●
Description●
Interface●
Example●
Warnings●
See Also●
Synopsis
#include<functional>
// typedefs
template <class Arg, class Result>
struct unary_function;
template <class Arg1, class Arg2, class Result>
struct binary_function;
Description
Function objects are objects with an operator() defined. They are important for the effective use
of the standard library's generic algorithms, because the interface for each algorithmic template
can accept either an object with an operator() defined, or a pointer to a function. The Standard
C++ Library provides both a standard set of function objects, and a pair of classes that you can
use as the base for creating your own function objects.