Mám třídu BST stejný jako v tomto vlákně
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);
};
Snažil jsem se vrátit ukazatel z funkce jako hotové v tomto vlákně .
Definice minFunc je ve stejném souboru BST.hpp
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;
}
Nelze přijít na chyby kompilace :
error C2143: Chyba syntaxe: chybí ';' před '*'
Chyba C2065: 'T': nedeklarovaný identifikátor
Chyba C2955: ‚BST‘: použití šablony třídy requ i res šablony seznam argumentů
Chyba C2509: ‚minFunc‘: členská funkce, které nejsou prohlášeny za ‚BST‘
to vše ukazuje na definici













