Skip to content

Commit

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

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

0 comments on commit 551f476

Please # to comment.