aboutsummaryrefslogtreecommitdiff
path: root/src/prevector.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-12-13 19:36:46 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2016-12-21 18:28:33 -0800
commit2ddfcfd2d67bc2bd8aa4682ceaba6a59614e54d1 (patch)
treed2a24af811a5e43a5e3026a9ffed8a0aecb7fc7d /src/prevector.h
parente8cfe1ee2d01c493b758a67ad14707dca15792ea (diff)
downloadbitcoin-2ddfcfd2d67bc2bd8aa4682ceaba6a59614e54d1.tar.xz
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.h9
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;
}