pointer to overridden member function
Posted on 1999-01-18
I am trying to write a helper template function that takes a pointer to a member function. In most cases the template works - however, when the member function I am trying to get the address of is overloaded, the compiler understandably complains. How can I retrieve the address of an overloaded member function?
Here is an example (never compiled, but might give you and idea):
template <class CToSave, class CSaver>
// this line works:
bool retVal = SaveUtl(&bar, &file, bar.*Bar::Save);
// the next line is the one that the compiler complains about.
bool retVal = SaveUtl(&foo, &file, foo.*Foo::Save);
If it helps/hinders at all, I am using MS Visual C++ Version 6.0. (and no comments from the peanut gallery! <sigh>)