Skip to content

Commit 761c150

Browse files
committed
fix: properly forward writef args
1 parent 8da98d5 commit 761c150

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

ecsact/codegen/plugin.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ struct codegen_plugin_context {
163163

164164
template<typename... Args>
165165
auto writef(std::format_string<Args...> fmt, Args&&... args) {
166-
auto str = std::format(fmt, std::forward(args)...);
166+
auto str = std::format(fmt, std::forward<Args>(args)...);
167167
write_(str.data(), static_cast<int32_t>(str.size()));
168168
}
169169

test/mock_plugin.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ auto ecsact_codegen_plugin( //
3434
[[maybe_unused]] ecsact_codegen_write_fn_t write_fn,
3535
[[maybe_unused]] ecsact_codegen_report_fn_t report_fn
3636
) -> void {
37+
auto ctx = ecsact::codegen_plugin_context{package_id, 0, write_fn, report_fn};
38+
auto world = std::string{"world"};
39+
ctx.writef("hello {}", world);
3740
}

0 commit comments

Comments
 (0)