From 688e6ad79fcc443d395351f15e447005b668d8dc Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 12 Aug 2019 17:52:13 +0200 Subject: [PATCH] minor changes --- src/entt/entity/registry.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 40749f037..b505228d3 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -203,8 +203,8 @@ class basic_registry { struct pool_data { std::unique_ptr> pool; - std::unique_ptr>(* clone)(const sparse_set &); void(* remove)(sparse_set &, basic_registry &, const Entity); + std::unique_ptr>(* clone)(const sparse_set &); ENTT_ID_TYPE runtime_type; }; @@ -289,7 +289,7 @@ class basic_registry { static_cast &>(other).remove(registry, entt); }; - pdata->clone = [](const sparse_set &other) -> std::unique_ptr> { + pdata->clone = []([[maybe_unused]] const sparse_set &other) -> std::unique_ptr> { if constexpr(std::is_copy_constructible_v>) { return std::make_unique>(static_cast &>(other)); } else { @@ -1442,10 +1442,10 @@ public: /** * @brief Clones the given components and all the entity identifiers. * - * The components must be copiable for obvious reasons. The entities + * The components must be copyable for obvious reasons. The entities * maintain their versions once copied.
* If no components are provided, the registry will try to clone all the - * existing pools. + * existing pools. The ones for non-copyable types won't be cloned. * * This feature supports exclusion lists. The excluded types have higher * priority than those indicated for cloning. An excluded type will never be @@ -1485,11 +1485,11 @@ public: && !((pdata.runtime_type == to_integer(type())) || ...)) { auto &curr = other.pools[pos-1]; - curr.clone = pdata.clone; curr.remove = pdata.remove; + curr.clone = pdata.clone; curr.pool = pdata.clone(*pdata.pool); curr.runtime_type = pdata.runtime_type; - ENTT_ASSERT(sizeof...(Component) == 0 || curr.pool); + ENTT_ASSERT(!sizeof...(Component) || curr.pool); } }