Parcourir la source

mixin: avoid move/swap after move/swap

Michele Caini il y a 1 an
Parent
commit
4cb70d3c2d
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/entt/entity/mixin.hpp

+ 2 - 2
src/entt/entity/mixin.hpp

@@ -152,11 +152,11 @@ public:
      * @return This mixin.
      * @return This mixin.
      */
      */
     basic_sigh_mixin &operator=(basic_sigh_mixin &&other) noexcept {
     basic_sigh_mixin &operator=(basic_sigh_mixin &&other) noexcept {
-        underlying_type::operator=(std::move(other));
         owner = other.owner;
         owner = other.owner;
         construction = std::move(other.construction);
         construction = std::move(other.construction);
         destruction = std::move(other.destruction);
         destruction = std::move(other.destruction);
         update = std::move(other.update);
         update = std::move(other.update);
+        underlying_type::operator=(std::move(other));
         return *this;
         return *this;
     }
     }
 
 
@@ -166,11 +166,11 @@ public:
      */
      */
     void swap(basic_sigh_mixin &other) {
     void swap(basic_sigh_mixin &other) {
         using std::swap;
         using std::swap;
-        underlying_type::swap(other);
         swap(owner, other.owner);
         swap(owner, other.owner);
         swap(construction, other.construction);
         swap(construction, other.construction);
         swap(destruction, other.destruction);
         swap(destruction, other.destruction);
         swap(update, other.update);
         swap(update, other.update);
+        underlying_type::swap(other);
     }
     }
 
 
     /**
     /**