I have this function:
template <typename T>
List<T>::ListNode *List<T>::find(int index) const
{
if ( (index < 1) || (index > getLength()) )
return NULL;
else
{
ListNode *cur = head;
for (int skip = 1; skip < index; ++skip)
cur = cur->next;
return cur;
}
}
That is giving me these two errors, each on the second line:
expected constructor, destructor, or type conversion before '*' token
expected `;' before '*' token
All my other methods that use templates work just fine. I think the problem is that my syntax where I am calling my ListNode struct is wrong. I had this working without templates earlier and now I'm trying to implement it with templates and I am getting these errors.