Commit c0854473 authored by blackball's avatar blackball

Implement = operator for BigInteger

There's a copy constructor, but no '=' operator implemented. This is dangerous.
parent fc50f103
......@@ -51,7 +51,14 @@ public:
if (length > 0)
AppendDecimal64(decimals + i, decimals + i + length);
}
BigInteger& operator=(const BigInteger &rhs)
{
count_ = rhs.count_;
std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type));
return *this;
}
BigInteger& operator=(uint64_t u) {
digits_[0] = u;
count_ = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment