Invoking Functors
Invoking a functor is straightforward. Each functor class overloads
operator() to provide a style of invocation identical to that of a function call, as shown in
Example 67.
Example 67 – Invoking functors
void function1(void);
RWTFunctor<void()> functor1 = function1;
functor1(); // Invocation
int function2(int);
RWTFunctor<int(int)> functor2 = function2;
int result = functor2(10); // Invocation (passing caller data)