diff options
| author | Pieter Wuille <[email protected]> | 2016-12-13 19:36:46 -0800 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-12-21 18:28:33 -0800 |
| commit | 2ddfcfd2d67bc2bd8aa4682ceaba6a59614e54d1 (patch) | |
| tree | d2a24af811a5e43a5e3026a9ffed8a0aecb7fc7d /src/prevector.h | |
| parent | Merge #8589: Inline CTxInWitness inside CTxIn (diff) | |
| download | discoin-2ddfcfd2d67bc2bd8aa4682ceaba6a59614e54d1.tar.xz discoin-2ddfcfd2d67bc2bd8aa4682ceaba6a59614e54d1.zip | |
Make CScript (and prevector) c++11 movable.
Such moves are used when reallocating vectors that contain them,
for example.
Diffstat (limited to 'src/prevector.h')
| -rw-r--r-- | src/prevector.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/prevector.h b/src/prevector.h index 25bce522d..46af80d1e 100644 --- a/src/prevector.h +++ b/src/prevector.h @@ -248,6 +248,10 @@ public: } } + prevector(prevector<N, T, Size, Diff>&& other) : _size(0) { + swap(other); + } + prevector& operator=(const prevector<N, T, Size, Diff>& other) { if (&other == this) { return *this; @@ -263,6 +267,11 @@ public: return *this; } + prevector& operator=(prevector<N, T, Size, Diff>&& other) { + swap(other); + return *this; + } + size_type size() const { return is_direct() ? _size : _size - N - 1; } |