Skip to content

Commit

Permalink
fix: add missing return type in context.remove (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy authored Jun 19, 2024
1 parent 551f476 commit 02f96d9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cpp_systems_header_codegen/cpp_systems_header_codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,14 @@ static void write_context_add_specialize(
cpp_full_name
),
[&] {
ctx.write(std::format("_ctx.add<{}>(new_component)", cpp_full_name));
ctx.write(std::format("_ctx.add<{}>(new_component);", cpp_full_name));
}
);
} else {
block(
ctx,
std::format("template<> auto add<{}>() -> void", cpp_full_name),
[&] { ctx.write(std::format("_ctx.add<{}>()", cpp_full_name)); }
[&] { ctx.write(std::format("_ctx.add<{}>();", cpp_full_name)); }
);
}

Expand Down Expand Up @@ -346,9 +346,13 @@ static auto write_context_remove_specialize(
auto full_name = ecsact_meta_decl_full_name(decl_id);
auto cpp_full_name = cpp_identifier(full_name);

block(ctx, std::format("template<> auto remove<{}>()", cpp_full_name), [&] {
ctx.write(std::format("return _ctx.remove<{}>();\n", cpp_full_name));
});
block(
ctx,
std::format("template<> auto remove<{}>() -> void", cpp_full_name),
[&] {
ctx.write(std::format("return _ctx.remove<{}>();\n", cpp_full_name));
}
);

ctx.write("\n");
}
Expand Down

0 comments on commit 02f96d9

Please # to comment.