Skip to content

Commit

Permalink
Use perfect forwardnig to preserve the parameters for log (shader-sla…
Browse files Browse the repository at this point in the history
…ng#5841)

Avoid mixing the variadic template argument and pass-through it with std::forward
  • Loading branch information
jkwak-work authored Dec 12, 2024
1 parent c17369a commit 1f3be30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/example-base/example-base.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ int64_t getTimerFrequency();
template<typename... TArgs>
inline void reportError(const char* format, TArgs... args)
{
printf(format, args...);
printf(format, std::forward<TArgs>(args)...);
#ifdef _WIN32
char buffer[4096];
sprintf_s(buffer, format, args...);
sprintf_s(buffer, format, std::forward<TArgs>(args)...);
_Win32OutputDebugString(buffer);
#endif
}
Expand Down

0 comments on commit 1f3be30

Please sign in to comment.