c++ - 错误:'operator==' 不匹配(操作数类型为 'const C4::C4TrackKey' 和 'const C4::C4TrackKey')
问题描述
我似乎无法理解我收到的这个错误:
namespace C4
{
struct STA
{
C4::C4TrackKey track_key;
C4::C4TrackNumber track_number;
bool operator==(const STA &rhs) const
{
bool is_equal = false;
if(this->track_key == rhs.track_key &&
this->track_number == rhs.track_number)
{
is_equal = true;
}
return is_equal;
};
错误:'operator==' 不匹配(操作数类型为 'const namespace::struct' 和 'const namespace::struct')
操作数类型相同,其他比较编译得很好。
解决方案
推荐阅读
- javascript - 将数组与另一个数组进行比较,匹配所有元素(TypeScript、Angular Pipe)
- python - 为什么python3找不到已经安装的模块?
- c - C中未定义类型的结构字段
- c# - Unity 功能自动完成不起作用
- sql - 没有逻辑插入顺序的数据的非聚集索引
- vba - 读取 CR/LF 字符时出现 VBA PPT 错误
- javascript - 如何获取 JSON 数组的值的总和?
- java - 休眠:保存多个关联问题
- azure-keyvault - 将密钥保管库机密传递给 Data.tf 和在 Main.tf 中引用的问题
- python - 如何从字符串python正则表达式的中间消除对字母数字字符的检查