To create a functor, you
Construct a handle
Construct and initialize a compatible body
Bind that body to the handle
The simplest way to do this is to use a global template function to create the body, such as the rwtMakeFunctor0() function in the following example.
Example 69 shows the minimal code required for building and using a functor.
#include <rw/functor/functor0.h> void func(void); // build a functor to encapsulate function func RWFunctor0 functor = rwtMakeFunctor0((void(*)(void))0,func); //invoke the functor functor();
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.