Skip to content

fix: add missing return type in context.remove #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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