I have a simple fraction class that I'm working on and I've been overloading various operators and they all work apart from my division operator. For some reason even though it's marked as a const method like all the other operators that return a new Frac and is near identical to the * operator Xcode complains Candidate function not viable: 'this' argument has type 'const Frac', but method is not marked const. Am I missing something hear or is Xcode not telling me to do what I've already done?
Frac operator/(const Frac &r2) const
{
return this->isRational && r2.isRational ? Frac(this->numerator * r2.denominator, this->denominator * r2.numerator) : Frac(this->floatRatio / r2.floatRatio);
}