Merge branch 'mtszkarbowiak-fix/swapping'

This commit is contained in:
Wojtek Figat
2023-12-11 11:28:32 +01:00
3 changed files with 3 additions and 7 deletions

View File

@@ -734,9 +734,7 @@ public:
}
else
{
Array tmp = MoveTemp(other);
other = *this;
*this = MoveTemp(tmp);
::Swap(other, *this);
}
}

View File

@@ -616,9 +616,7 @@ public:
}
else
{
Dictionary tmp = MoveTemp(other);
other = *this;
*this = MoveTemp(tmp);
::Swap(other, *this);
}
}

View File

@@ -304,7 +304,7 @@ template<typename T>
inline void Swap(T& a, T& b) noexcept
{
T tmp = MoveTemp(a);
a = b;
a = MoveTemp(b);
b = MoveTemp(tmp);
}