summaryrefslogtreecommitdiff
path: root/src/string.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/string.hh')
-rw-r--r--src/string.hh8
1 files changed, 4 insertions, 4 deletions
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<const StringView> params);
template<typename... Types>
-String format(StringView fmt, Types... params)
+String format(StringView fmt, Types&&... params)
{
- return format(fmt, ArrayView<const StringView>{detail::format_param(params)...});
+ return format(fmt, ArrayView<const StringView>{detail::format_param(std::forward<Types>(params))...});
}
StringView format_to(ArrayView<char> buffer, StringView fmt, ArrayView<const StringView> params);
template<typename... Types>
-StringView format_to(ArrayView<char> buffer, StringView fmt, Types... params)
+StringView format_to(ArrayView<char> buffer, StringView fmt, Types&&... params)
{
- return format_to(buffer, fmt, ArrayView<const StringView>{detail::format_param(params)...});
+ return format_to(buffer, fmt, ArrayView<const StringView>{detail::format_param(std::forward<Types>(params))...});
}
}