aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/bigint/bigint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/bigint/bigint.cpp')
-rw-r--r--src/math/bigint/bigint.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/math/bigint/bigint.cpp b/src/math/bigint/bigint.cpp
index 6fa929b6d..a13c4f234 100644
--- a/src/math/bigint/bigint.cpp
+++ b/src/math/bigint/bigint.cpp
@@ -40,7 +40,7 @@ BigInt::BigInt(Sign s, size_t size)
}
/*
-* Construct a BigInt from a "raw" BigInt
+* Copy constructor
*/
BigInt::BigInt(const BigInt& b)
{
@@ -100,6 +100,25 @@ BigInt::BigInt(RandomNumberGenerator& rng, size_t 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
*/