I have a simple container :
template list {
public:
struct node {
nodeType info;
node* next;
You need to tell the compiler that node
is a type using the keyword typename
.Otherwise it will think node as a static
variable in class list
. Add typename
whenever you use node as a type in your implementation of list.
that's because node
is a dependent type. You need to write the signature as follows (note that I have broken it into 2 lines for clarity)
template <class nodeType>
typename list<nodeType>::node* list<nodeType>::_search()
{
//function
}
Note the use of the typename
keyword.