summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-12-11 16:45:10 -0800
committerGitHub <noreply@github.com>2024-12-11 16:45:10 -0800
commit1f3be303e7f54f04b6eebfa5973838df89282a68 (patch)
tree08873dfd07509113b50364e64015ae8548e57453 /examples
parentc17369a507c9b2e3a2db409896dbdc7e250122c1 (diff)
Use perfect forwardnig to preserve the parameters for log (#5841)
Avoid mixing the variadic template argument and pass-through it with std::forward
Diffstat (limited to 'examples')
-rw-r--r--examples/example-base/example-base.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/example-base/example-base.h b/examples/example-base/example-base.h
index 0cb3de7e9..6988d613b 100644
--- a/examples/example-base/example-base.h
+++ b/examples/example-base/example-base.h
@@ -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
}