diff --git a/src/string.hh b/src/string.hh index cae9b170..056db814 100644 --- a/src/string.hh +++ b/src/string.hh @@ -418,17 +418,17 @@ StringView format_param(const T& val) { return val; } String format(StringView fmt, ArrayView params); template -String format(StringView fmt, Types... params) +String format(StringView fmt, Types&&... params) { - return format(fmt, ArrayView{detail::format_param(params)...}); + return format(fmt, ArrayView{detail::format_param(std::forward(params))...}); } StringView format_to(ArrayView buffer, StringView fmt, ArrayView params); template -StringView format_to(ArrayView buffer, StringView fmt, Types... params) +StringView format_to(ArrayView buffer, StringView fmt, Types&&... params) { - return format_to(buffer, fmt, ArrayView{detail::format_param(params)...}); + return format_to(buffer, fmt, ArrayView{detail::format_param(std::forward(params))...}); } }