I have the following call:
void Derived::GetEntry(Skill&);
InorderTraverse(GetEntry);
Which calls
void Base<ItemType>::InorderTraverse(void Visit(ItemType&)) const
Attempting to compile as written generates
error C3867: 'Derived::GetEntry': function call missing argument list; use '&Derived::GetEntry' to create a pointer to member
Using &Derived::GetEntry generates
cannot convert parameter 1 from 'void (__thiscall Derived::* )(Skill &)' to 'void (__cdecl *)(ItemType &)'
Changing the declaration to static void GetEntry... fixes these problems, but creates a new set of problems (namely that I can't access non-static objects (nonstatic member reference must be relative to a specific object)
I have a similar traversal operation that works fine with a static declaration, since the called function just displays information about each object on which it is called.
I've been searching for a few days now for an answer, and I feel like it's something simple. Is there a way to use a nonstatic function as a parameter in another function call?
The complete code is: https://github.com/mindaika/SkillTree