Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordkavolis <12998363+dkavolis@users.noreply.github.com>2020-11-02 03:37:03 +0300
committerdkavolis <12998363+dkavolis@users.noreply.github.com>2020-11-02 03:37:03 +0300
commit23572369fced02f41cc1cfef061540192df56986 (patch)
treead62b07010b94f1b8bcc99e479cdb0031ac05a54 /include/spdlog/spdlog.h
parent01b350de96483cf00b267c6db4c25f3b739b3fee (diff)
Perfect forwarding for arguments
Diffstat (limited to 'include/spdlog/spdlog.h')
-rw-r--r--include/spdlog/spdlog.h32
1 files changed, 16 insertions, 16 deletions
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<spdlog::logger> default_logger);
template<typename FormatString, typename... Args>
-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>(args)...);
}
template<typename FormatString, typename... Args>
-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>(args)...);
}
template<typename FormatString, typename... Args>
-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>(args)...);
}
template<typename FormatString, typename... Args>
-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>(args)...);
}
template<typename FormatString, typename... Args>
-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>(args)...);
}
template<typename FormatString, typename... Args>
-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>(args)...);
}
template<typename FormatString, typename... Args>
-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>(args)...);
}
template<typename FormatString, typename... Args>
-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>(args)...);
}
template<typename T>