From 4b44d9d152ecf4a58435f3db5861df945fe0f37f Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Thu, 12 Sep 2024 10:19:31 +0200 Subject: [PATCH] Perfect forwarding --- src/utils/logger.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/logger.hpp b/src/utils/logger.hpp index f079a2179d..41fe6c4cde 100644 --- a/src/utils/logger.hpp +++ b/src/utils/logger.hpp @@ -4,20 +4,20 @@ extern int (*nrnpy_pr_stdoe_callback)(int, char*); -template -int Fprintf(FILE* stream, const char* fmt, T... args) { +template +int Fprintf(FILE* stream, const char* fmt, Args... args) { if (nrnpy_pr_stdoe_callback && (stream == stdout || stream == stderr)) { - std::string message = fmt::sprintf(fmt, args...); + std::string message = fmt::sprintf(fmt, std::forward(args)...); nrnpy_pr_stdoe_callback(stream == stdout ? 1 : 2, message.data()); return message.size(); } return fmt::fprintf(stream, fmt, args...); } -template -int Printf(const char* fmt, T... args) { +template +int Printf(const char* fmt, Args... args) { if (nrnpy_pr_stdoe_callback) { - std::string message = fmt::sprintf(fmt, args...); + std::string message = fmt::sprintf(fmt, std::forward(args)...); nrnpy_pr_stdoe_callback(1, message.data()); return message.size(); }