From 9bb2210c9290546a3ffaff0122620ec41545f4f5 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 9 Feb 2019 20:00:09 +0100 Subject: [PATCH] Part: Geometry extensions set interface ======================================= unique_ptr is a move only type. Therefore it may only take an rvalue. It does not make sense a pass by value for move only types (Item 41). --- src/Mod/Part/App/Geometry.cpp | 2 +- src/Mod/Part/App/Geometry.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index e6c96ceae9..7ad718e9db 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -288,7 +288,7 @@ const std::weak_ptr Geometry::getExtension(Base::Type type) c throw Base::ValueError("No geometry extension of the requested type."); } -void Geometry::setExtension(std::unique_ptr geo) +void Geometry::setExtension(std::unique_ptr && geo) { bool hasext=false; diff --git a/src/Mod/Part/App/Geometry.h b/src/Mod/Part/App/Geometry.h index c8e4a1d678..2334c6dd75 100644 --- a/src/Mod/Part/App/Geometry.h +++ b/src/Mod/Part/App/Geometry.h @@ -101,7 +101,7 @@ public: bool hasExtension(Base::Type type) const; const std::weak_ptr getExtension(Base::Type type) const; - void setExtension(std::unique_ptr geo); + void setExtension(std::unique_ptr &&geo); protected: /// create a new tag for the geometry object