Skip to content

Commit

Permalink
fmt(): Pass arguments by reference rather than by value
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Dec 5, 2019
1 parent f4b9495 commit 334b8f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libutil/logging.hh
Expand Up @@ -158,7 +158,7 @@ extern Verbosity verbosity; /* suppress msgs > this */
#define vomit(args...) printMsg(lvlVomit, args)

template<typename... Args>
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)...};
Expand Down
2 changes: 1 addition & 1 deletion src/libutil/types.hh
Expand Up @@ -67,7 +67,7 @@ inline std::string fmt(const FormatOrString & fs)
}

template<typename... Args>
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);
Expand Down

0 comments on commit 334b8f8

Please sign in to comment.