Skip to content

Commit

Permalink
fix swap of eastl::list<unique_ptr[]>
Browse files Browse the repository at this point in the history
...or any other type that has deleted dtor.
```
const this_type temp(*this); // << This would attept to call copy ctor of unique_ptr<> which is explicitly deleted
*this = x;
x     = temp;
```
  • Loading branch information
Vladimir 'virtul' Ivannikov committed Feb 4, 2025
1 parent 7fadbf0 commit 841664f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/EASTL/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -1575,8 +1575,8 @@ namespace eastl
DoSwap(x);
else // else swap the contents.
{
const this_type temp(*this); // Can't call eastl::swap because that would
*this = x; // itself call this member swap function.
this_type temp(*this); // Can't call eastl::swap because that would
*this = x; // itself call this member swap function.
x = temp;
}
}
Expand Down

0 comments on commit 841664f

Please sign in to comment.