diff options
author | Jacques Lucke <jacques@blender.org> | 2021-09-28 11:17:49 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-09-28 11:17:49 +0300 |
commit | def8fd6330fde5a7add9ab89efb6c08576355eb2 (patch) | |
tree | be7837b747ef198b706364cc4687e596f96b9a40 /source/blender/blenkernel/BKE_geometry_set.hh | |
parent | e7b9423623d30ff962c926d4ccc6e27f3cba675c (diff) |
Cleanup: support moving InstanceReference
Diffstat (limited to 'source/blender/blenkernel/BKE_geometry_set.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_geometry_set.hh | 17 |
1 files changed, 17 insertions, 0 deletions
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_; |