Try the following minimal example:
struct Spot {
int x, y;
};
int main() {
Spot{0, 1} == Spot{2, 3};
}
This doesn't compile, as you can test for yourself.
<source>(56): error C2676: binary '==': 'Spot' does not define this operator or a conversion to a type acceptable to the predefined operator
In this case, the error message is way clearer. The compiler doesn't know, how to compare to objects of type Spot
and how should it, you never defined how that would work.
You can help yourself with a defined operator==()
like the following:
bool operator==(const Spot& lhs, const Spot& rhs) {
return lhs.x == rhs.x && lhs.y == rhs.y;
}