aoapc-book / aoapc-bac2nd

Source codes for book <<<BeginningAlgorithmContests>> Second edition
2.7k stars 1.01k forks source link

return by reference of the BigInteger after copy assignment (operator =). #24

Open SXongin opened 6 years ago

SXongin commented 6 years ago

I think return by reference rather then by value after assignment (operator =) is more reasonable. return a reference can make the struct BigInteger more similar to the built-in int.

consider the code following: int one; BigInterger big_one; (one = 1) = 2; (big_one = 1) =2; after assignment, both big_one and one should be 2. can do this by return reference after assignment.