diff options
Diffstat (limited to 'src/math/bigint/bigint.cpp')
-rw-r--r-- | src/math/bigint/bigint.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/math/bigint/bigint.cpp b/src/math/bigint/bigint.cpp index 7592ec439..36739f047 100644 --- a/src/math/bigint/bigint.cpp +++ b/src/math/bigint/bigint.cpp @@ -40,7 +40,7 @@ BigInt::BigInt(Sign s, u32bit size) } /* -* Construct a BigInt from a "raw" BigInt +* Copy constructor */ BigInt::BigInt(const BigInt& b) { @@ -100,6 +100,29 @@ BigInt::BigInt(RandomNumberGenerator& rng, u32bit bits) randomize(rng, bits); } +/** +* Move constructor +*/ +BigInt::BigInt(BigInt&& other) + { + reg.swap(other.reg); + signedness = other.signedness; + } + +/** +* Move assignment +*/ +BigInt& BigInt::operator=(BigInt&& other) + { + if(this != &other) + { + reg.swap(other.reg); + signedness = other.signedness; + } + + return (*this); + } + /* * Swap this BigInt with another */ |