From 88677eb893b4a8d690675a1a3b66de1a14838a3b Mon Sep 17 00:00:00 2001 From: lisyarus Date: Tue, 30 Jan 2024 21:56:52 +0300 Subject: [PATCH] Make constructors & destructors operate on const components only in ecs --- libs/ecs/include/psemek/ecs/container.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/ecs/include/psemek/ecs/container.hpp b/libs/ecs/include/psemek/ecs/container.hpp index 94276f65..8d67d241 100644 --- a/libs/ecs/include/psemek/ecs/container.hpp +++ b/libs/ecs/include/psemek/ecs/container.hpp @@ -629,7 +629,7 @@ namespace psemek::ecs { static_assert(detail::all_different_types_v...>, "all component types must be different"); - using invocable_type = typename detail::filter_with, Function>::type; + using invocable_type = typename detail::filter_with, Function>::type; static_assert(invocable_type::value, "function is not invocable with these components"); @@ -637,7 +637,7 @@ namespace psemek::ecs cache->constructor_factory = [function = std::move(function)](std::vector const & column_indices) -> detail::table_callback { return [function, column_indices](container & container, detail::table & table, std::uint32_t row){ - typename detail::filter_with>::type apply_helper(container, table.entity_handles()); + typename detail::filter_with>::type apply_helper(container, table.entity_handles()); for (std::size_t i = 0; i < apply_helper.column_count; ++i) apply_helper.pointers[i] = table.columns()[column_indices[i]]->data(); @@ -655,7 +655,7 @@ namespace psemek::ecs { static_assert(detail::all_different_types_v...>, "all component types must be different"); - using invocable_type = typename detail::filter_with, Function>::type; + using invocable_type = typename detail::filter_with, Function>::type; static_assert(invocable_type::value, "function is not invocable with these components"); @@ -663,7 +663,7 @@ namespace psemek::ecs cache->destructor_factory = [function = std::move(function)](std::vector const & column_indices) -> detail::table_callback { return [function, column_indices](container & container, detail::table & table, std::uint32_t row){ - typename detail::filter_with>::type apply_helper(container, table.entity_handles()); + typename detail::filter_with>::type apply_helper(container, table.entity_handles()); for (std::size_t i = 0; i < apply_helper.column_count; ++i) apply_helper.pointers[i] = table.columns()[column_indices[i]]->data();