From 334b8f8af1c47970e6cdf3ca6f45dfb8cd8e7938 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 5 Dec 2019 17:39:11 +0100 Subject: [PATCH] fmt(): Pass arguments by reference rather than by value --- src/libutil/logging.hh | 2 +- src/libutil/types.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libutil/logging.hh b/src/libutil/logging.hh index 5df03da74..3fbd75562 100644 --- a/src/libutil/logging.hh +++ b/src/libutil/logging.hh @@ -158,7 +158,7 @@ extern Verbosity verbosity; /* suppress msgs > this */ #define vomit(args...) printMsg(lvlVomit, args) template -inline void warn(const std::string & fs, Args... args) +inline void warn(const std::string & fs, const Args & ... args) { boost::format f(fs); nop{boost::io::detail::feed(f, args)...}; diff --git a/src/libutil/types.hh b/src/libutil/types.hh index 4bc91828b..4a6be28a2 100644 --- a/src/libutil/types.hh +++ b/src/libutil/types.hh @@ -67,7 +67,7 @@ inline std::string fmt(const FormatOrString & fs) } template -inline std::string fmt(const std::string & fs, Args... args) +inline std::string fmt(const std::string & fs, const Args & ... args) { boost::format f(fs); f.exceptions(boost::io::all_error_bits ^ boost::io::too_many_args_bit);