gpt4 book ai didi

visual-c++ - VC++ 又出现了那个该死的 C2679 错误

转载 作者:行者123 更新时间:2023-12-02 10:47:18 25 4
gpt4 key购买 nike

有一个 Day 类,其中包含保存数据的成员。

我有一个包含 Day 对象数组的 RedBlackTree 类。

Day m_list[MAX_LIST];

上面的代码会导致此错误:

错误 3 错误 C2679:二进制“=”:未找到采用“const Month”类型右侧操作数的运算符(或没有可接受的转换)c:\program files\microsoft visual studio 8\vc\include\xutility 2949
int m_list[MAX_LIST];

当我用 Day 代替整数时,我没有收到错误。我在日间课上缺少什么。
我确实有这个运营​​商=
const Day & Day::operator=(Day &otherDay)
{
if(this != &otherDay) // avoid self copy
Copy(otherDay);

return *this;
}

最佳答案

它在提示 Day缺少 operator=接受 const Month& 类型的参数.
xutility header 是 Visual Studio 提供的标准库实现的内部 header 。查看第 2949 行的功能,这将为您指明问题的方向。

关于visual-c++ - VC++ 又出现了那个该死的 C2679 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2874099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com