Skip to content

Commit c47b589

Browse files
authored
Generates compile fix (#14)
1 parent daa6b3b commit c47b589

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

ecsact/entt/detail/system_execution_context.hh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ namespace ecsact_entt_rt {
223223
const C& get() {
224224
#ifndef NDEBUG
225225
assert(
226-
info.registry.all_of<C>(entity) &&
226+
info.registry.template all_of<C>(entity) &&
227227
"context get called for wrong component type. "
228228
"Check system capabilities."
229229
);
@@ -257,8 +257,11 @@ namespace ecsact_entt_rt {
257257
>>;
258258

259259
#ifndef NDEBUG
260+
[[maybe_unused]]
260261
bool found_gettable_component = false;
262+
[[maybe_unused]]
261263
const char* get_component_name = "";
264+
[[maybe_unused]]
262265
auto gettable_components_type_name = typeid(gettable_components).name();
263266
#endif//NDEBUG
264267

ecsact/entt/runtime.hh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,20 @@ namespace ecsact::entt {
554554
using boost::mp11::mp_flatten;
555555
using boost::mp11::mp_push_back;
556556
using boost::mp11::mp_map_find;
557+
using boost::mp11::mp_first;
558+
using boost::mp11::mp_transform;
557559
using ecsact::entt::detail::pending_add;
558560
using ecsact::entt_mp11_util::mp_map_find_value_or;
559561

560562
using caps_info = ecsact::system_capabilities_info<SystemT>;
561563

562-
using system_generates = typename caps_info::generates;
564+
using system_generates = mp_transform<
565+
mp_first,
566+
mp_flatten<
567+
typename caps_info::generates,
568+
::ecsact::mp_list<>
569+
>
570+
>;
563571
using adds_components = typename caps_info::adds_components;
564572
static_assert(!std::is_same_v<system_generates, void>);
565573

@@ -775,7 +783,7 @@ namespace ecsact::entt {
775783
auto& assoc_view_itr = std::get<I>(assoc_views_itrs);
776784
constexpr std::size_t offset = Assoc::field_offset;
777785
assert(view.contains(entity));
778-
auto& comp = view.get<ComponentT>(entity);
786+
auto& comp = view.template get<ComponentT>(entity);
779787
auto field_entity_value = *reinterpret_cast<const ecsact_entity_id*>(
780788
reinterpret_cast<const char*>(&comp) + offset
781789
);

runtime/test/runtime_test.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ void runtime_test::OtherEntitySystem::impl(context& ctx) {
2626
other.update(other_comp);
2727
}
2828

29+
void runtime_test::MakeAnother::impl(context& ctx) {
30+
31+
}
32+
2933
TEST(Core, CreateRegistry) {
3034
auto reg_id = ecsact_create_registry("CreateRegistry");
3135
EXPECT_NE(reg_id, ecsact_invalid_registry_id);

runtime/test/runtime_test.ecsact

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,10 @@ system OtherEntitySystem {
2020
readwrite ComponentA;
2121
}
2222
}
23+
24+
action MakeAnother {
25+
readwrite ComponentA;
26+
generates {
27+
required OtherEntityComponent;
28+
}
29+
}

0 commit comments

Comments
 (0)