I'm trying to define an == operator in a structure:
typedef struct _tBScan {
QString strQuadpackNumbers;
uint uintBegin, uintEnd;
bool operator==(const struct _tBScan& a, const struct _tBScan& b) {
return (a.strQuadpackNumbers.compare(b.strQuadpackNumbers) == 0 &&
a.uintBegin == b.uintBegin && a.uintEnd == b.uintEnd);
}
} tBScan;
This won't compile, I get:
C2804: binary 'operator ==' has too many parameters
C2333: '_tBScan::operator ==' error in function: declaration: skipping function body
I'm using Qt 5.9.2 and MSVC 2015, I need to define this so I can use the QList compare function.