Skip to content

Commit

Permalink
Add opPostMove to vector
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed Oct 9, 2024
1 parent 9addaf0 commit b76e124
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/numem/collections/vector.d
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
}
}
}

/**
Expand Down

0 comments on commit b76e124

Please sign in to comment.