aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-03-06 23:24:02 +0100
committerEven Rouault <even.rouault@spatialys.com>2021-03-07 00:20:20 +0100
commit43e123533412eb161bdd138917d78cf79a510fb6 (patch)
tree82829578288b76fce1ceedcdbdfc9b42c5785903
parent6dae91bd0626dd91b3b729a8b58e72128d2928e1 (diff)
downloadPROJ-43e123533412eb161bdd138917d78cf79a510fb6.tar.gz
PROJ-43e123533412eb161bdd138917d78cf79a510fb6.zip
BaseObject: add a move assignment operator (CID 314820)
-rw-r--r--include/proj/util.hpp1
-rw-r--r--src/iso19111/common.cpp1
-rw-r--r--src/iso19111/util.cpp11
3 files changed, 13 insertions, 0 deletions
diff --git a/include/proj/util.hpp b/include/proj/util.hpp
index 78115aa1..acc793cc 100644
--- a/include/proj/util.hpp
+++ b/include/proj/util.hpp
@@ -331,6 +331,7 @@ class PROJ_GCC_DLL BaseObject {
protected:
PROJ_INTERNAL BaseObject();
PROJ_INTERNAL void assignSelf(const BaseObjectNNPtr &self);
+ PROJ_INTERNAL BaseObject &operator=(BaseObject &&other);
private:
PROJ_OPAQUE_PRIVATE_DATA
diff --git a/src/iso19111/common.cpp b/src/iso19111/common.cpp
index 7a0d122d..b70845ae 100644
--- a/src/iso19111/common.cpp
+++ b/src/iso19111/common.cpp
@@ -120,6 +120,7 @@ UnitOfMeasure &UnitOfMeasure::operator=(const UnitOfMeasure &other) {
//! @cond Doxygen_Suppress
UnitOfMeasure &UnitOfMeasure::operator=(UnitOfMeasure &&other) {
+ BaseObject::operator=(std::move(static_cast<BaseObject &&>(other)));
*d = std::move(*(other.d));
return *this;
}
diff --git a/src/iso19111/util.cpp b/src/iso19111/util.cpp
index 21d45e44..7b69f4aa 100644
--- a/src/iso19111/util.cpp
+++ b/src/iso19111/util.cpp
@@ -81,6 +81,17 @@ BaseObjectNNPtr::~BaseObjectNNPtr() = default;
// ---------------------------------------------------------------------------
+//! @cond Doxygen_Suppress
+// cppcheck-suppress operatorEqVarError
+BaseObject &BaseObject::operator=(BaseObject &&) {
+ d->self_.reset();
+ return *this;
+}
+
+//! @endcond
+
+// ---------------------------------------------------------------------------
+
/** Keep a reference to ourselves as an internal weak pointer. So that
* extractGeographicBaseObject() can later return a shared pointer on itself.
*/