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(); }