Value is a string that contains the value of the bignum, excluding the sign of it which is held by the bool sign. The third parameter of the add and subtract functions is the sign of the result. Also, I have a non-explicit templated constructor that parses through the parameter so thatCode:BigNum BigNum::operator+(const BigNum& rhs) { if(sign) { if(rhs.GetSign()) { if(this->abs()>rhs.abs()) return Add(this->value, rhs.GetValue(), true); else return Add(rhs.GetValue(), this->value, true); } else { if(this->abs()>rhs.abs()) return Subtract(this->GetValue(), rhs.GetValue(), true); else return Subtract(rhs.GetValue(), this->GetValue(), false); } }else{ if(rhs.GetSign()) { if(this->abs()>=rhs.abs()) return Subtract(this->GetValue(), rhs.GetValue(), false); else return Subtract(rhs.GetValue(), this->GetValue(), true); }else{ if(this->abs()>rhs.abs()) return Add(this->value, rhs.GetValue(), false); else return Add(rhs.GetValue(), this->value, false); } } } inline BigNum BigNum::abs() { return BigNum(value); }
Here's the error:
356 passing `const BigNum' as `this' argument of `class BigNum BigNum::abs()' discards qualifiers
It is found at every if statement with the abs calls.



LinkBack URL
About LinkBacks


