lundi 6 juillet 2020

Function changes parent but not child

I got a parent class named BST that uses templates, it has a function called insert and I have a child class Called AVL that inherits from BST.. I got an insert function in the parent, but when I call the insert function from the child like so:

BST<T>::insert(element);

It inserts the new node created to the parent class but not the child AVL class, however I want to use the same insert function to insert to the child class not the parent, is there a way.

Aucun commentaire:

Enregistrer un commentaire