Skip to content

Commit

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

this = *(emplace(&this, other));
return this;
auto object = list!(Type)(other);
return object;
}
///
void assign(size_type count, ref const value_type value);
Expand Down

0 comments on commit 5e47e2e

Please sign in to comment.