O
Ook
What am I doing wrong? This code gives a compile error:
'SortedList<T>::insert' : illegal call of non-static member function. I've
tried several variations of this, but keep getting the same error.
template <typename T>
class SortedList
{
public:
void insert( T item); // Write this
};
//-------------------------------------------------
template <typename T>
void SortedList<T>::insert( T item)
{
}
int main()
{
int i = 123;
SortedList<int>::insert(i);
return 0;
}
'SortedList<T>::insert' : illegal call of non-static member function. I've
tried several variations of this, but keep getting the same error.
template <typename T>
class SortedList
{
public:
void insert( T item); // Write this
};
//-------------------------------------------------
template <typename T>
void SortedList<T>::insert( T item)
{
}
int main()
{
int i = 123;
SortedList<int>::insert(i);
return 0;
}