Skip to content

Commit

Permalink
destory, emplace new object in address, return
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmankoko committed Aug 22, 2024
1 parent 5e47e2e commit a305697
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/stdcpp/list.d
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,11 @@ extern(C++, class) struct list(Type, Allocator)
///
ref list opAssign(ref const list other)
{
auto object = list!(Type)(other);
return object;
import core.lifetime : emplace;

desroy!false(this);
emplace(&this, object);
return this;
}
///
void assign(size_type count, ref const value_type value);
Expand Down

0 comments on commit a305697

Please sign in to comment.