Skip to content

Commit

Permalink
Perfect forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu committed Sep 12, 2024
1 parent b338163 commit 4b44d9d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/utils/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

extern int (*nrnpy_pr_stdoe_callback)(int, char*);

template <typename... T>
int Fprintf(FILE* stream, const char* fmt, T... args) {
template <typename... Args>
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<Atgs>(args)...);

Check failure on line 10 in src/utils/logger.hpp

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 - cmake (-DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_INTERVIEWS=OFF -DNMODL_SANITIZERS=undefinedundefined)

unknown type name 'Atgs'; did you mean 'Args'?

Check failure on line 10 in src/utils/logger.hpp

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 - cmake (-DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_INTERVIEWS=OFF -DNMODL_SANITIZERS=undefinedundefined)

unknown type name 'Atgs'; did you mean 'Args'?

Check failure on line 10 in src/utils/logger.hpp

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 - cmake (-DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_INTERVIEWS=OFF -DNMODL_SANITIZERS=undefinedundefined)

unknown type name 'Atgs'; did you mean 'Args'?

Check failure on line 10 in src/utils/logger.hpp

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 - cmake (-DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_INTERVIEWS=OFF -DNMODL_SANITIZERS=undefinedundefined)

unknown type name 'Atgs'; did you mean 'Args'?

Check failure on line 10 in src/utils/logger.hpp

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 - cmake (-DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_INTERVIEWS=OFF -DNMODL_SANITIZERS=undefinedundefined)

unknown type name 'Atgs'; did you mean 'Args'?
nrnpy_pr_stdoe_callback(stream == stdout ? 1 : 2, message.data());
return message.size();
}
return fmt::fprintf(stream, fmt, args...);
}

template <typename... T>
int Printf(const char* fmt, T... args) {
template <typename... Args>
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>(args)...);
nrnpy_pr_stdoe_callback(1, message.data());
return message.size();
}
Expand Down

0 comments on commit 4b44d9d

Please sign in to comment.