Ver Fonte

meta: refine meta_any move ctor

skypjack há 5 meses atrás
pai
commit
1a02b6ad57
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      src/entt/meta/meta.hpp

+ 5 - 1
src/entt/meta/meta.hpp

@@ -323,7 +323,11 @@ public:
      * @param other The instance to move from.
      */
     meta_any(meta_any &&other) noexcept
-        : meta_any{*other.ctx, std::move(other)} {}
+        : storage{std::move(other.storage)},
+          ctx{other.ctx},
+          resolve{std::exchange(other.resolve, nullptr)},
+          node{std::exchange(other.node, nullptr)},
+          vtable{std::exchange(other.vtable, nullptr)} {}
 
     /**
      * @brief Copy assignment operator.