Function Object

Many of the STL algorithms have a parameter which is
a function, for_each( ) and transform( )
being prime examples. That functional parameter doesn't have to be
an actual function. It can be an object that behaves like a function.
Such an object is called a "function object" or "functor".

A function is something that can be called using the parenthese and
passing arguments -- myFunction( arg1, arg2). We can make
objects behave this way by overloading operator( ).

But why would we want to do this?
Function objects are like "smart functions".

They can have abilities beyond just operator( ).

They can save information between function calls (have a "state").

You can have separate copies of each function by
instantiating more than one function object. Each function object could
have a separate state.