This is really bugging me. I'm working on overloading the comparison operators in C++, and I'm getting a weird error that I'm not sure how to correct.
The code I'm working with looks like this:
bool HugeInt::operator==(const HugeInt& h) const{
return h.integer == this->integer;
}
bool HugeInt::operator!=(const HugeInt& h) const{
return !(this == h);
}
where integer
is a short [30]
The ==
overloading works fine. But when I try to use it in the !=
body, it tells me that ==
has not been defined. I'm new to C++, so any tips are welcome.
Thanks!