I have made a templated class, Node<K,D>.
Say I have some code that goes:
and then I want to make potato and gun children of the ham node.
If i declare the node pointers as
then I can only point to nodes of type Node<K,D>, so ham could not point to potato and gun. Perhaps the solution is to use void pointers - but
returns this error:
error: `void*' is not a pointer-to-object type
How do you suggest I expand the functionality of my Node pointers so that they can point to any Node, regardless of the type of keys or data it possesses?