mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Make CScript (and prevector) c++11 movable.
Such moves are used when reallocating vectors that contain them, for example.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user