I am overloading the assignment operator, and am getting this error. Cannot solve it.
Here is the prototype inside template class binTree
binTree <T>& operator = ( const binTree <T>& ); // assignment operator
Here is the method
// assignment operator
template <class T>
void binTree <T>::binTree <T>& operator = ( const binTree <T>& p)
{
if( this != &p )
{
clear(root); // clear tree
root = copy(p.root); // copy tree
}
return *this;
}
I am getting the error on this line
void binTree <T>::binTree <T>& operator = ( const binTree <T>& p)
From your declaration
Your class type is
your member is
Your return type is
So your definition is