diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index d6ab33962a..a2bd694438 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -781,9 +781,9 @@ IOFile::IOFile(IOFile&& other) Swap(other); } -IOFile& IOFile::operator=(IOFile other) +IOFile& IOFile::operator=(IOFile&& other) { - Swap(other); + IOFile(std::move(other)).Swap(*this); return *this; } diff --git a/Source/Core/Common/Src/FileUtil.h b/Source/Core/Common/Src/FileUtil.h index 2c8bf8f64b..b8e8d9c17c 100644 --- a/Source/Core/Common/Src/FileUtil.h +++ b/Source/Core/Common/Src/FileUtil.h @@ -160,7 +160,7 @@ public: ~IOFile(); IOFile(IOFile&& other); - IOFile& operator=(IOFile other); + IOFile& operator=(IOFile&& other); void Swap(IOFile& other);