From the base class you derive a template class TSpecificFunctor which is initialized with a pointer to an object and a pointer to a member function in its constructor. If you are not sure of how to use function pointers take a look at my Introduction to Function Pointers . We create an array with two pointers to TFunctor and initialize the array entries with two pointers to TSpecificFunctor which encapsulate the pointer to an object and the pointer to a member of TClassA respectively TClassB . Then we use the functor-array to call the respective member functions. All code pieces were highlighted using the free lore's source converter .
All trademarks are the sole property of their respective owners.
I do NOT promote, speak in the behalf of, advertise or work for ANY computing, news or internet profit business.