I have this code (just a snippet)
const Line & operator= (rhs : const Line &)
{
}
But I am getting:
Unknown type name 'rhs'
What should I do?
I have this code (just a snippet)
const Line & operator= (rhs : const Line &)
{
}
But I am getting:
Unknown type name 'rhs'
What should I do?
You need to write
Line& operator=(const Line& rhs)
Note the placement of rhs
.
I've also dropped the const
at the beginning of the line since the conventional thing to return when overriding assignment is a reference to self, not a const
reference to self.