views:

55

answers:

1

Hi,

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 &otherDay)
{
    if(this != &otherDay)       // avoid self copy
        Copy(otherDay);

    return *this;
}
+1  A: 

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.

Joe Gauterin
sbi
Ok? I don't think I have any code that wants Day to = const MonthI can only think that in my Month class, I do not have a operator=.Other than that, what code should I be looking for in my project?
Jean-Noel
Also can someone please explain why I would get this error by having that line to create an array of Days?
Jean-Noel
I've updated my answer with more detail.
Joe Gauterin