diff --git a/source/numem/collections/vector.d b/source/numem/collections/vector.d index 19da3e5..fd39985 100644 --- a/source/numem/collections/vector.d +++ b/source/numem/collections/vector.d @@ -546,6 +546,18 @@ public: this._memcpy(cast(T*)slice.ptr, cast(T*)values.ptr, slice.length); } + + /** + Handle struct moves. + */ + @trusted + void opPostMove(ref typeof(this) old) nothrow { + if (old.memory) { + this.memory = cast(valueType*)old.memory; + this.size_ = old.size_; + this.capacity_ = old.capacity_; + } + } } /**