Просмотр исходного кода

registry: swap based move assignment operator

Michele Caini 1 год назад
Родитель
Сommit
3b4864aeae
1 измененных файлов с 1 добавлено и 7 удалено
  1. 1 7
      src/entt/entity/registry.hpp

+ 1 - 7
src/entt/entity/registry.hpp

@@ -377,13 +377,7 @@ public:
      * @return This registry.
      */
     basic_registry &operator=(basic_registry &&other) noexcept {
-        vars = std::move(other.vars);
-        pools = std::move(other.pools);
-        groups = std::move(other.groups);
-        entities = std::move(other.entities);
-
-        rebind();
-
+        swap(other);
         return *this;
     }