Skip to content

Commit 841664f

Browse files
author
Vladimir 'virtul' Ivannikov
committed
fix swap of eastl::list<unique_ptr[]>
...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; ```
1 parent 7fadbf0 commit 841664f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/EASTL/list.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,8 +1575,8 @@ namespace eastl
15751575
DoSwap(x);
15761576
else // else swap the contents.
15771577
{
1578-
const this_type temp(*this); // Can't call eastl::swap because that would
1579-
*this = x; // itself call this member swap function.
1578+
this_type temp(*this); // Can't call eastl::swap because that would
1579+
*this = x; // itself call this member swap function.
15801580
x = temp;
15811581
}
15821582
}

0 commit comments

Comments
 (0)