From d9ad574a6916bf8b42addbfdd4f82bd571b7190d Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 8 Oct 2024 09:41:11 +0200 Subject: [PATCH] storage: internal changes --- src/entt/entity/storage.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index fc7920832..9b0e5dd83 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -266,8 +266,8 @@ class basic_storage: public basic_sparse_set(it.index())); - entt::uninitialized_construct_using_allocator(to_address(elem), get_allocator(), std::forward(args)...); + auto *elem = to_address(assure_at_least(static_cast(it.index()))); + entt::uninitialized_construct_using_allocator(elem, get_allocator(), std::forward(args)...); } ENTT_CATCH { base_type::pop(it, it + 1u);