struct Node { typedef bool ExpandFn(/*some args here*/); virtual ExpandFn expand_group; virtual ExpandFn expand_file; }; bool Node::expand_group(/*some args here*/) { ... } bool Node::expand_file(/*some args here*/) { ... }