From 7382addfe49e4187ae7a59eb052ee4470dddfbfe Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Sat, 4 May 2019 18:06:03 +0200 Subject: [PATCH] minor changes --- src/entt/entity/registry.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 47b7422c7..54761a910 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -63,6 +63,8 @@ class basic_registry { template struct pool_handler: sparse_set { + using underlying_type = sparse_set; + sigh on_construct; sigh on_replace; sigh on_destroy; @@ -259,8 +261,9 @@ class basic_registry { pdata->clone = +[](const sparse_set &cpool) -> std::unique_ptr> { if constexpr(std::is_copy_constructible_v>) { - std::unique_ptr>> ptr = std::make_unique>(); - *ptr = static_cast> &>(cpool); + using underlying_type = typename pool_type::underlying_type; + std::unique_ptr ptr = std::make_unique>(); + *ptr = static_cast(cpool); return std::move(ptr); } else { ENTT_ASSERT(false);