From 97e0d631021141ed6034a7715f61992a87b046ba Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 13 Mar 2020 23:08:59 +0100 Subject: [PATCH] storage: consume args for empty types in all cases --- TODO | 1 + src/entt/entity/storage.hpp | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index c35cc4fc9a..ea0bd6f329 100644 --- a/TODO +++ b/TODO @@ -15,6 +15,7 @@ * document undocumented parts (entt::overload and a few others) * any-of rule for views/groups (eg entity has A and any of B/C/D) - get -> all, exclude -> none +* review multi component views to reduce instantiations once empty types are gone... Next: * replace observer class with observer functions diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index 3072b8f756..f402cbd723 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -694,16 +694,15 @@ class storage>: public spa * * @tparam Args Types of arguments to use to construct the object. * @param entt A valid entity identifier. + * @param args Parameters to use to construct an object for the entity. */ template - void emplace(const entity_type entt, Args &&...) { + void emplace(const entity_type entt, Args &&... args) { + [[maybe_unused]] object_type instance{std::forward(args)...}; underlying_type::construct(entt); } - /** - * @copydoc emplace - * @param args Parameters to use to construct an object for the entity. - */ + /*! @copydoc emplace */ template [[deprecated("use ::emplace instead")]] void construct(const entity_type entt, Args &&... args) {