From 03edd28f60fc800e06481e0dd11b9bd183683690 Mon Sep 17 00:00:00 2001 From: github_actions Date: Tue, 21 Nov 2023 15:28:33 +0000 Subject: [PATCH] Automated single-include header generation --- include/ecs/ecs.ixx | 40 ++++++++++++++++++++-------------------- include/ecs/ecs_sh.h | 40 ++++++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/include/ecs/ecs.ixx b/include/ecs/ecs.ixx index 132b068e..722b090f 100644 --- a/include/ecs/ecs.ixx +++ b/include/ecs/ecs.ixx @@ -4552,27 +4552,27 @@ namespace ecs { static_assert((!std::is_pointer_v> && ...), "can not add pointers to entities; wrap them in a struct"); static_assert((!detail::is_variant_of_pack()), "Can not add more than one component from the same variant"); - auto const adder = [this, range](Type&& val) { - // Add it to the component pool - if constexpr (detail::is_parent::value) { - detail::component_pool& pool = ctx.get_component_pool(); - Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); - pool.add(range, detail::parent_id{val.id()}); - } else if constexpr (std::is_reference_v) { - using DerefT = std::remove_cvref_t; - static_assert(std::copyable, "Type must be copyable"); - - detail::component_pool& pool = ctx.get_component_pool(); - Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); - pool.add(range, val); - } else { - static_assert(std::copyable, "Type must be copyable"); + auto const adder = [this, range](Type&& val) { + // Add it to the component pool + if constexpr (detail::is_parent::value) { + detail::component_pool& pool = ctx.get_component_pool(); + Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); + pool.add(range, detail::parent_id{val.id()}); + } else if constexpr (std::is_reference_v) { + using DerefT = std::remove_cvref_t; + static_assert(std::copyable, "Type must be copyable"); + + detail::component_pool& pool = ctx.get_component_pool(); + Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); + pool.add(range, val); + } else { + static_assert(std::copyable, "Type must be copyable"); - detail::component_pool& pool = ctx.get_component_pool(); - Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); - pool.add(range, std::forward(val)); - } - }; + detail::component_pool& pool = ctx.get_component_pool(); + Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); + pool.add(range, std::forward(val)); + } + }; (adder(std::forward(vals)), ...); } diff --git a/include/ecs/ecs_sh.h b/include/ecs/ecs_sh.h index 63edb4cb..329c5f46 100644 --- a/include/ecs/ecs_sh.h +++ b/include/ecs/ecs_sh.h @@ -4552,27 +4552,27 @@ namespace ecs { static_assert((!std::is_pointer_v> && ...), "can not add pointers to entities; wrap them in a struct"); static_assert((!detail::is_variant_of_pack()), "Can not add more than one component from the same variant"); - auto const adder = [this, range](Type&& val) { - // Add it to the component pool - if constexpr (detail::is_parent::value) { - detail::component_pool& pool = ctx.get_component_pool(); - Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); - pool.add(range, detail::parent_id{val.id()}); - } else if constexpr (std::is_reference_v) { - using DerefT = std::remove_cvref_t; - static_assert(std::copyable, "Type must be copyable"); - - detail::component_pool& pool = ctx.get_component_pool(); - Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); - pool.add(range, val); - } else { - static_assert(std::copyable, "Type must be copyable"); + auto const adder = [this, range](Type&& val) { + // Add it to the component pool + if constexpr (detail::is_parent::value) { + detail::component_pool& pool = ctx.get_component_pool(); + Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); + pool.add(range, detail::parent_id{val.id()}); + } else if constexpr (std::is_reference_v) { + using DerefT = std::remove_cvref_t; + static_assert(std::copyable, "Type must be copyable"); + + detail::component_pool& pool = ctx.get_component_pool(); + Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); + pool.add(range, val); + } else { + static_assert(std::copyable, "Type must be copyable"); - detail::component_pool& pool = ctx.get_component_pool(); - Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); - pool.add(range, std::forward(val)); - } - }; + detail::component_pool& pool = ctx.get_component_pool(); + Pre(!pool.has_entity(range), "one- or more entities in the range already has this type"); + pool.add(range, std::forward(val)); + } + }; (adder(std::forward(vals)), ...); }