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

meta: drop redundant constructors for meta_any

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

+ 10 - 7
src/entt/meta/meta.hpp

@@ -187,11 +187,6 @@ class meta_any {
         }
     }
 
-    meta_any(const meta_any &other, any ref) noexcept
-        : storage{std::move(ref)},
-          node{storage ? other.node : internal::meta_type_node{}},
-          vtable{storage ? other.vtable : &basic_vtable<void>} {}
-
 public:
     /*! @brief Default constructor. */
     meta_any() noexcept
@@ -528,12 +523,20 @@ public:
 
     /*! @copydoc any::as_ref */
     [[nodiscard]] meta_any as_ref() noexcept {
-        return meta_any{*this, storage.as_ref()};
+        meta_any other{};
+        other.storage = storage.as_ref();
+        other.node = storage ? node : other.node;
+        other.vtable = vtable;
+        return other;
     }
 
     /*! @copydoc any::as_ref */
     [[nodiscard]] meta_any as_ref() const noexcept {
-        return meta_any{*this, storage.as_ref()};
+        meta_any other{};
+        other.storage = storage.as_ref();
+        other.node = storage ? node : other.node;
+        other.vtable = vtable;
+        return other;
     }
 
     /*! @copydoc any::owner */