diff options
Diffstat (limited to 'src/math/bigint/bigint.cpp')
-rw-r--r-- | src/math/bigint/bigint.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/math/bigint/bigint.cpp b/src/math/bigint/bigint.cpp index 1f3255175..85d7c48ff 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,25 @@ BigInt::BigInt(RandomNumberGenerator& rng, u32bit bits) randomize(rng, bits); } +/** +* Move constructor +*/ +BigInt::BigInt(BigInt&& other) + { + std::swap(*this, other); + } + +/** +* Move assignment +*/ +BigInt& BigInt::operator=(BigInt&& other) + { + if(this != &other) + std::swap(*this, other); + + return (*this); + } + /* * Swap this BigInt with another */ |