From ea050c9cfcd219e139fe92b12d45be7e41bb3161 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Mon, 1 Apr 2019 16:34:47 +0200 Subject: [PATCH] MSVC also fails to automatically move if no elision possible --- src/Mod/Part/App/GeometryDefaultExtension.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mod/Part/App/GeometryDefaultExtension.cpp b/src/Mod/Part/App/GeometryDefaultExtension.cpp index 86effad2a0..1a4e79ded0 100644 --- a/src/Mod/Part/App/GeometryDefaultExtension.cpp +++ b/src/Mod/Part/App/GeometryDefaultExtension.cpp @@ -81,10 +81,10 @@ std::unique_ptr GeometryDefaultExtension::copy(void) cpy->value = this->value; cpy->setName(this->getName()); - #if defined(__GNUC__) && __GNUC__ < 7 - return std::move(cpy); // GCC 4.8 bug + #if (defined(__GNUC__) && __GNUC__ < 7 ) || defined(_MSC_VER) + return std::move(cpy); // GCC 4.8 and MSC do not support automatic move constructor call if the compiler fails to elide #else - return cpy; // all the others use RVO optimization perfectly fine. + return cpy; // all the others do automatic move constructor if RVO optimization not possible. #endif // Advise from Scott Meyers Effective Modern c++: //