First page Back Continue Last page Graphics
At first, you could consider a function object as an ordinary function that is written in a more complicted way: Instead of writing all the function statements inside the function body,
At first, you could consider a function object as an ordinary function that is written in a more complicted way: Instead of writing all the function statements inside the function body,
- void fo( ) {
- statements
- }
you write them inside the body of operator ( ) of the function object class:
- class FunctionObjectType {
- public:
- void operator( ) (...) {
- statements
- }
- }