From 2a40c6dc927cb76cc74a04d1ad032bbf4a039fff Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 26 Aug 2019 10:50:32 -0400 Subject: [PATCH] logvisor: std::forward arguments where applicable Forwards arguments into functions to preserve their value category --- include/logvisor/logvisor.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/logvisor/logvisor.hpp b/include/logvisor/logvisor.hpp index 83599ba..20c5450 100644 --- a/include/logvisor/logvisor.hpp +++ b/include/logvisor/logvisor.hpp @@ -220,7 +220,7 @@ public: return; _vreport(severity, fmt::to_string_view(format), fmt::basic_format_args>( - fmt::internal::make_args_checked(format, args...))); + fmt::internal::make_args_checked(format, std::forward(args)...))); } template @@ -242,10 +242,9 @@ public: void reportSource(Level severity, const char* file, unsigned linenum, const S& format, Args&&... args) { if (MainLoggers.empty() && severity != Level::Fatal) return; - _vreportSource( - severity, file, linenum, fmt::to_string_view(format), - fmt::basic_format_args>( - fmt::internal::make_args_checked(format, args...))); + _vreportSource(severity, file, linenum, fmt::to_string_view(format), + fmt::basic_format_args>( + fmt::internal::make_args_checked(format, std::forward(args)...))); } template