From def8fd6330fde5a7add9ab89efb6c08576355eb2 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 28 Sep 2021 10:17:49 +0200 Subject: Cleanup: support moving InstanceReference --- source/blender/blenkernel/BKE_geometry_set.hh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/blender/blenkernel/BKE_geometry_set.hh') diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh index 08bfdbf2382..f6a58e57298 100644 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@ -509,6 +509,13 @@ class InstanceReference { } } + InstanceReference(InstanceReference &&other) + : type_(other.type_), data_(other.data_), geometry_set_(std::move(other.geometry_set_)) + { + other.type_ = Type::None; + other.data_ = nullptr; + } + InstanceReference &operator=(const InstanceReference &other) { if (this == &other) { @@ -519,6 +526,16 @@ class InstanceReference { return *this; } + InstanceReference &operator=(InstanceReference &&other) + { + if (this == &other) { + return *this; + } + this->~InstanceReference(); + new (this) InstanceReference(std::move(other)); + return *this; + } + Type type() const { return type_; -- cgit v1.2.3