diff options
-rw-r--r-- | AK/String.cpp | 2 | ||||
-rw-r--r-- | AK/String.h | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/AK/String.cpp b/AK/String.cpp index dae488464c..f20a4ae61e 100644 --- a/AK/String.cpp +++ b/AK/String.cpp @@ -515,7 +515,7 @@ InputStream& operator>>(InputStream& stream, String& string) } } -String String::vformatted(StringView fmtstr, TypeErasedFormatParams params) +String String::vformatted(StringView fmtstr, TypeErasedFormatParams& params) { StringBuilder builder; vformat(builder, fmtstr, params); diff --git a/AK/String.h b/AK/String.h index 9bc3e5e2d1..f043729624 100644 --- a/AK/String.h +++ b/AK/String.h @@ -265,12 +265,13 @@ public: return String((const char*)buffer.data(), buffer.size(), should_chomp); } - [[nodiscard]] static String vformatted(StringView fmtstr, TypeErasedFormatParams); + [[nodiscard]] static String vformatted(StringView fmtstr, TypeErasedFormatParams&); template<typename... Parameters> [[nodiscard]] static String formatted(CheckedFormatString<Parameters...>&& fmtstr, const Parameters&... parameters) { - return vformatted(fmtstr.view(), VariadicFormatParams { parameters... }); + VariadicFormatParams variadic_format_parameters { parameters... }; + return vformatted(fmtstr.view(), variadic_format_parameters); } template<typename T> |