From 27d0e5f55e8ce4b2478c9538823311f4e8f970c5 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Sun, 9 Oct 2022 11:34:56 +0200 Subject: [PATCH] meta: always forward the context to meta_func --- src/entt/meta/meta.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index f3f231c7d..a79ba7168 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -821,7 +821,7 @@ struct meta_func { * @param curr The underlying node with which to construct the instance. * @param area The context from which to search for meta types. */ - meta_func(const internal::meta_func_node &curr, const meta_ctx /* _TODO*/ &area = locator::value_or()) noexcept + meta_func(const internal::meta_func_node &curr, const meta_ctx &area) noexcept : node{&curr}, ctx{&area} {} @@ -916,7 +916,7 @@ struct meta_func { * @return The next overload of the given function, if any. */ [[nodiscard]] meta_func next() const { - return node->next ? meta_func{*node->next} : meta_func{}; + return node->next ? meta_func{*node->next, *ctx} : meta_func{}; } /** @@ -1234,7 +1234,7 @@ public: [[nodiscard]] meta_func func(const id_type id) const { if(node.details) { if(const auto it = node.details->func.find(id); it != node.details->func.cend()) { - return it->second; + return meta_func{it->second, *ctx}; } }