I have the BST class same as in this thread
BST.hpp
template<class T>
class BinarySearchTree
{
private:
struct tree_node
{
tree_node* left;
tree_node* right;
T data;
tree_node( const T & thedata, tree_node * l = NULL, tree_node * r = NULL )
: data( thedata ), left( l ), right( r ) { }
};
tree_node* root;
public:
//some functions
private:
struct tree_node* minFunc( tree_node** node);
};
I was trying to return a pointer from the function as done in this thread.
the definition of minFunc is in the same BST.hpp file
template <class T>
struct tree_node* BST<T>::minFunc(tree_node** node)
{
tree_node* current = *node;
while(current->left != NULL)
{
current = current->left;
}
return current;
}
Unable to figure out the compile errors:
error C2143: syntax error : missing ';' before '*'
error C2065: 'T' : undeclared identifier
error C2955: 'BST' : use of class template requires template argument list
error C2509: 'minFunc' : member function not declared in 'BST'
all these pointing to the definition