From ad7f0c22863938d382e17659561c7a55a058c6bd Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Thu, 12 Jan 2023 19:11:30 -0800 Subject: [PATCH] Moved make_arg_formatter to printf.h Per PR suggestion. --- include/fmt/format.h | 5 ----- include/fmt/printf.h | 10 +++++++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 70764bff4e77..8f05c7d92cf9 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3592,11 +3592,6 @@ template struct arg_formatter { // to the parse context. return out; } - - static auto make_arg_formatter(iterator iter, format_specs& s) - -> arg_formatter { - return {iter, s, locale_ref()}; - } }; template struct custom_formatter { diff --git a/include/fmt/printf.h b/include/fmt/printf.h index 40ebede416d7..cae051d7b711 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -218,6 +218,14 @@ template class printf_width_handler { } }; +// Workaround for a bug with the XL compiler when initializing +// printf_arg_formatter's base class. +template +auto make_arg_formatter(buffer_appender iter, format_specs& s) + -> arg_formatter { + return {iter, s, locale_ref()}; +} + // The ``printf`` argument formatter. template class printf_arg_formatter : public arg_formatter { @@ -235,7 +243,7 @@ class printf_arg_formatter : public arg_formatter { public: printf_arg_formatter(OutputIt iter, format_specs& s, context_type& ctx) - : base(base::make_arg_formatter(iter, s)), context_(ctx) {} + : base(make_arg_formatter(iter, s)), context_(ctx) {} OutputIt operator()(monostate value) { return base::operator()(value); }