From 23572369fced02f41cc1cfef061540192df56986 Mon Sep 17 00:00:00 2001 From: dkavolis <12998363+dkavolis@users.noreply.github.com> Date: Mon, 2 Nov 2020 00:37:03 +0000 Subject: Perfect forwarding for arguments --- include/spdlog/spdlog.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'include/spdlog/spdlog.h') diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index d09a3d6d..bb130d94 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -128,51 +128,51 @@ SPDLOG_API spdlog::logger *default_logger_raw(); SPDLOG_API void set_default_logger(std::shared_ptr default_logger); template -inline void log(source_loc source, level::level_enum lvl, const FormatString &fmt, const Args &...args) +inline void log(source_loc source, level::level_enum lvl, const FormatString &fmt, Args&&...args) { - default_logger_raw()->log(source, lvl, fmt, args...); + default_logger_raw()->log(source, lvl, fmt, std::forward(args)...); } template -inline void log(level::level_enum lvl, const FormatString &fmt, const Args &...args) +inline void log(level::level_enum lvl, const FormatString &fmt, Args&&...args) { - default_logger_raw()->log(source_loc{}, lvl, fmt, args...); + default_logger_raw()->log(source_loc{}, lvl, fmt, std::forward(args)...); } template -inline void trace(const FormatString &fmt, const Args &...args) +inline void trace(const FormatString &fmt, Args&&...args) { - default_logger_raw()->trace(fmt, args...); + default_logger_raw()->trace(fmt, std::forward(args)...); } template -inline void debug(const FormatString &fmt, const Args &...args) +inline void debug(const FormatString &fmt, Args&&...args) { - default_logger_raw()->debug(fmt, args...); + default_logger_raw()->debug(fmt, std::forward(args)...); } template -inline void info(const FormatString &fmt, const Args &...args) +inline void info(const FormatString &fmt, Args&&...args) { - default_logger_raw()->info(fmt, args...); + default_logger_raw()->info(fmt, std::forward(args)...); } template -inline void warn(const FormatString &fmt, const Args &...args) +inline void warn(const FormatString &fmt, Args&&...args) { - default_logger_raw()->warn(fmt, args...); + default_logger_raw()->warn(fmt, std::forward(args)...); } template -inline void error(const FormatString &fmt, const Args &...args) +inline void error(const FormatString &fmt, Args&&...args) { - default_logger_raw()->error(fmt, args...); + default_logger_raw()->error(fmt, std::forward(args)...); } template -inline void critical(const FormatString &fmt, const Args &...args) +inline void critical(const FormatString &fmt, Args&&...args) { - default_logger_raw()->critical(fmt, args...); + default_logger_raw()->critical(fmt, std::forward(args)...); } template -- cgit v1.2.3