How can I reuse a base class function in a derived class
- by Armen Ablak
Let's say we have these four classes:
BinaryTree,
SplayTree (which is a sub-class of BinaryTree),
BinaryNode and
SplayNode (which is a sub-class of BinaryNode).
In class BinaryTree I have 2 Find functions, like this
bool Find(const T &) const;
virtual Node<T> * Find(const T &, Node<T> *) const;
and in SplayTree I would like to reuse the second one, because it works in the same way (for example) as in SplayTree, the only thing different is the return type, which is SplayNode.
I thought it might be enough if I use this line in SplayTree.cpp
using BinaryTree::Find;
but it isn't.
So, how can I do this?