That darn C2679 error again VC++
Have a Day class that contains members to hold data.
I have a RedBlackTree class that contains an array of Day objects.
Day m_list[MAX_LIST];
This code above causes this error:
Error 3 error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const Month' (or there is no acceptable conversion) c:\program files\microsoft visual studio 8\vc\include\xutility 2949
int m_list[MAX_LIST];
When I substitute Day for integer I do not get the error. What am I missing in my Day class. I do have this operator=
const Day & Day::operator=(Day &开发者_Python百科amp;otherDay)
{
if(this != &otherDay) // avoid self copy
Copy(otherDay);
return *this;
}
It's complaining about Day
missing an operator=
that takes a parameter of type const Month&
.
The xutility
header is an internal header from the standard library implementation supplied with Visual Studio. Look at what function line 2949 is in and that'll point you in the direction of your problem.
精彩评论