소스 검색

mixin: avoid move/swap after move/swap

Michele Caini 2 년 전
부모
커밋
4cb70d3c2d
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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);
     }
     }
 
 
     /**
     /**