From b480d8bc14d8b72c7a82f9aa5e4933d0c3cac3fc Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 4 Dec 2024 14:44:15 +0100 Subject: [PATCH] meta_any: cleanup --- TODO | 1 - src/entt/meta/meta.hpp | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 5a9652a23..fddd2be30 100644 --- a/TODO +++ b/TODO @@ -44,4 +44,3 @@ TODO: * built-in no-pagination storage - no_pagination page size as limits::max * meta_any ownership construction and from_void * sparse_set shrink_to_fit argument for sparse array shrink policy (none, empty, deep, whatever) -* meta_any: avoid initializing members with global context an void vtable diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index a5b9a946c..a907ddc45 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -218,7 +218,8 @@ class meta_any { public: /*! Default constructor. */ - meta_any() = default; + meta_any() + : meta_any{meta_ctx_arg, locator::value_or()} {} /** * @brief Context aware constructor. @@ -639,7 +640,7 @@ public: private: any storage{}; - const meta_ctx *ctx{&locator::value_or()}; + const meta_ctx *ctx{}; internal::meta_type_node node{}; vtable_type *vtable{}; };