I’ve searched through the other “expected Class Name” error questions on here, but they all “…before ‘{‘ token,” or “…before ‘;'”.
The solution was to include the right file, but my file is including the .h file that included the inherited class.
#include "BinaryNode.h"
#include "bst.h"
template <class T>
class SOBTree: public BinarySearchTree { //Expected Class Name
public:
void insert( const T& x );
void remove( const T& x );
int reportComparisonCount();
double reportCPUTime();
private:
void insert( const T & x, BinaryNode<T> * & t );
void RotateRight(BinaryNode<T> * & root );
void RotateLeft(BinaryNode<T> * & root );
BinaryNode<T> *root;
};
The inherited class is defined in bst.h, so I have no other files to include in the project.
Sorry for the easy question, I just don’t know why the error is happening.
Change
to
..as BinarySearchTree, is(definitely) a template too.