Function objects are objects specifically designed to be used with a syntax similar to that of functions. In C++, this is achieved by defining member function operator() in their class, like for example:
1 2 3 4
struct myclass {
intoperator()(int a) {return a;}
} myobject;
int x = myobject (0); // function-like syntax with object myobject
They are typically used as arguments to functions, such as predicates or comparison functions passed to standard algorithms.