Question: c++ templated and pointer function definition Question:How to define a templated and function that is a pointer to a struct inside the class? template <
c++ templated and pointer function definition
Question:How to define a templated and function that is a pointer to a struct inside the class?
template<typename theKey, typename theValue>
class BST
{
private:
struct node{
theKey key;
theValue value;
node* left;
node* right;
};
node* CreateLeaf(const theKey &x, const theValue &y);
public:
void insert(const theKey & x, const theValue & y);
};
//Now I want to defined the functions (particularly node* CreateLeaf(const theKey &x, const theValue &y); )
template<typename Key, typename Value>
BST< theKey, theValue>::node* BST
//define function
}
//Okay so my problem is that somehow my compiler say "Missing 'typename' prior to dependent type name 'BST
So what is wrong with this? What might be wrong with this?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
