From 2e59fbbccc54079e387d1b9b5744f38a27e2b9aa Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 11 Oct 2022 14:40:16 +0200 Subject: [PATCH] meta: * review pending functions to make them context aware if they aren't already * suppress a meta_associative_container::insert warning (rvalue-to-lvalue binding) --- src/entt/meta/meta.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index f187f34ca..026ea12ef 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -811,7 +811,6 @@ struct meta_data { */ template bool set(meta_handle instance, Type &&value) const { - // TODO propagate the context to the constructed value return node->set && node->set(std::move(instance), std::forward(value)); } @@ -952,7 +951,6 @@ struct meta_func { */ template meta_any invoke(meta_handle instance, Args &&...args) const { - // TODO meta_any arguments[sizeof...(Args) + 1u]{std::forward(args)...}; return invoke(std::move(instance), arguments, sizeof...(Args)); } @@ -1342,7 +1340,6 @@ public: */ template [[nodiscard]] meta_any construct(Args &&...args) const { - // TODO meta_any arguments[sizeof...(Args) + 1u]{std::forward(args)...}; return construct(arguments, sizeof...(Args)); } @@ -1410,7 +1407,6 @@ public: */ template meta_any invoke(const id_type id, meta_handle instance, Args &&...args) const { - // TODO meta_any arguments[sizeof...(Args) + 1u]{std::forward(args)...}; return invoke(id, std::move(instance), arguments, sizeof...(Args)); } @@ -1929,7 +1925,8 @@ inline bool meta_associative_container::clear() { * @return A bool denoting whether the insertion took place. */ inline bool meta_associative_container::insert(meta_any key) { - return (insert_or_erase_fn(storage, key, meta_any{*ctx, std::in_place_type}) != 0u); + meta_any value{*ctx, std::in_place_type}; + return (insert_or_erase_fn(storage, key, value) != 0u); } /**