diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-12-27 10:50:43 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-12-27 11:04:14 -0800 |
commit | 2db4cbcc437f51f5dac82cc4de46f383b92e6f11 (patch) | |
tree | eee83b2daf5af4d4a9478d3b47b1866d140a47c8 /src/prevector.h | |
parent | 7aa700424cbda387536373d8dfec88aee43f950e (diff) | |
parent | 2ddfcfd2d67bc2bd8aa4682ceaba6a59614e54d1 (diff) |
Merge #9349: Make CScript (and prevector) c++11 movable.
2ddfcfd Make CScript (and prevector) c++11 movable. (Pieter Wuille)
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 25bce522dc..46af80d1e6 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; } |