Fix usage of std::forward

This commit is contained in:
Charless Milette 2021-11-13 11:54:06 -05:00
parent 4008f31add
commit 6ff1b83038

View File

@ -364,10 +364,10 @@ protected:
SPDLOG_TRY SPDLOG_TRY
{ {
#ifdef SPDLOG_USE_STD_FORMAT #ifdef SPDLOG_USE_STD_FORMAT
memory_buf_t buf = std::vformat(fmt, std::make_format_args(std::forward<Args...>(args)...)); memory_buf_t buf = std::vformat(fmt, std::make_format_args(std::forward<Args>(args)...));
#else #else
memory_buf_t buf; memory_buf_t buf;
fmt::detail::vformat_to(buf, fmt, fmt::make_format_args(std::forward<Args...>(args)...)); fmt::detail::vformat_to(buf, fmt, fmt::make_format_args(std::forward<Args>(args)...));
#endif #endif
details::log_msg log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size())); details::log_msg log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size()));
log_it_(log_msg, log_enabled, traceback_enabled); log_it_(log_msg, log_enabled, traceback_enabled);
@ -390,10 +390,10 @@ protected:
// format to wmemory_buffer and convert to utf8 // format to wmemory_buffer and convert to utf8
; ;
#ifdef SPDLOG_USE_STD_FORMAT #ifdef SPDLOG_USE_STD_FORMAT
wmemory_buf_t wbuf = std::vformat(fmt, std::make_wformat_args(std::forward<Args...>(args)...)); wmemory_buf_t wbuf = std::vformat(fmt, std::make_wformat_args(std::forward<Args>(args)...));
#else #else
wmemory_buf_t wbuf; wmemory_buf_t wbuf;
fmt::detail::vformat_to(wbuf, fmt, fmt::make_format_args<fmt::wformat_context>(std::forward<Args...>(args)...)); fmt::detail::vformat_to(wbuf, fmt, fmt::make_format_args<fmt::wformat_context>(std::forward<Args>(args)...));
#endif #endif
memory_buf_t buf; memory_buf_t buf;
details::os::wstr_to_utf8buf(wstring_view_t(wbuf.data(), wbuf.size()), buf); details::os::wstr_to_utf8buf(wstring_view_t(wbuf.data(), wbuf.size()), buf);