From 52b41cfab56e3bf033cc2d41d78456916b12fba8 Mon Sep 17 00:00:00 2001 From: skypjack Date: Tue, 2 Dec 2025 17:29:59 +0100 Subject: [PATCH] registry: exploit std::allocator cross constructors --- src/entt/entity/registry.hpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 379e164d7..f7d7658f5 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -260,14 +260,7 @@ class basic_registry { } using alloc_type = typename storage_type::allocator_type; - typename pool_container_type::mapped_type cpool{}; - - if constexpr(std::is_void_v && !std::is_constructible_v) { - // std::allocator has no cross constructors (waiting for C++20) - cpool = std::allocate_shared(get_allocator(), alloc_type{}); - } else { - cpool = std::allocate_shared(get_allocator(), get_allocator()); - } + typename pool_container_type::mapped_type cpool = std::allocate_shared(get_allocator(), get_allocator()); pools.emplace(id, cpool); cpool->bind(*this);