diff options
author | lloyd <[email protected]> | 2009-12-16 22:54:39 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-12-16 22:54:39 +0000 |
commit | 1d595f8976483078c292e365bde3949c9de26332 (patch) | |
tree | 874f7cb1b2ba23405bc69330e6233eb567bf2ec4 /src/math/bigint/bigint.cpp | |
parent | f3f36611db8c3f6c67c818d454973a0165b0fcf2 (diff) | |
parent | 85b961ff87c1d6300451538c939c99a2ff74b505 (diff) |
propagate from branch 'net.randombit.botan' (head 22c82e10d78ad0e2cdaa56cb02f3d846ed0ead5e)
to branch 'net.randombit.botan.c++0x' (head 74dbf310b7fcc11f94a16cd63046219acd5d62bc)
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 a11960aca..1d234391c 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 */ |