Update thirdparty/fmt to 11.1.3

This commit is contained in:
Eidolon 2025-02-13 20:53:47 -06:00
parent a2d11a61f1
commit 6f9710f63d
9 changed files with 102 additions and 71 deletions

View file

@ -1,5 +1,5 @@
# Update from https://github.com/fmtlib/fmt # Update from https://github.com/fmtlib/fmt
# fmt 11.1.0 # fmt 11.1.3
# License: MIT with object code exception # License: MIT with object code exception
add_library(fmt INTERFACE) add_library(fmt INTERFACE)

View file

@ -21,7 +21,7 @@
#endif #endif
// The fmt library version in the form major * 10000 + minor * 100 + patch. // The fmt library version in the form major * 10000 + minor * 100 + patch.
#define FMT_VERSION 110100 #define FMT_VERSION 110103
// Detect compiler versions. // Detect compiler versions.
#if defined(__clang__) && !defined(__ibmxl__) #if defined(__clang__) && !defined(__ibmxl__)
@ -96,9 +96,9 @@
// Detect C++14 relaxed constexpr. // Detect C++14 relaxed constexpr.
#ifdef FMT_USE_CONSTEXPR #ifdef FMT_USE_CONSTEXPR
// Use the provided definition. // Use the provided definition.
#elif FMT_GCC_VERSION >= 600 && FMT_CPLUSPLUS >= 201402L #elif FMT_GCC_VERSION >= 702 && FMT_CPLUSPLUS >= 201402L
// GCC only allows throw in constexpr since version 6: // GCC only allows constexpr member functions in non-literal types since 7.2:
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67371. // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66297.
# define FMT_USE_CONSTEXPR 1 # define FMT_USE_CONSTEXPR 1
#elif FMT_ICC_VERSION #elif FMT_ICC_VERSION
# define FMT_USE_CONSTEXPR 0 // https://github.com/fmtlib/fmt/issues/1628 # define FMT_USE_CONSTEXPR 0 // https://github.com/fmtlib/fmt/issues/1628
@ -161,6 +161,20 @@
# define FMT_CATCH(x) if (false) # define FMT_CATCH(x) if (false)
#endif #endif
#ifdef FMT_NO_UNIQUE_ADDRESS
// Use the provided definition.
#elif FMT_CPLUSPLUS < 202002L
// Not supported.
#elif FMT_HAS_CPP_ATTRIBUTE(no_unique_address)
# define FMT_NO_UNIQUE_ADDRESS [[no_unique_address]]
// VS2019 v16.10 and later except clang-cl (https://reviews.llvm.org/D110485).
#elif FMT_MSC_VERSION >= 1929 && !FMT_CLANG_VERSION
# define FMT_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#endif
#ifndef FMT_NO_UNIQUE_ADDRESS
# define FMT_NO_UNIQUE_ADDRESS
#endif
#if FMT_HAS_CPP17_ATTRIBUTE(fallthrough) #if FMT_HAS_CPP17_ATTRIBUTE(fallthrough)
# define FMT_FALLTHROUGH [[fallthrough]] # define FMT_FALLTHROUGH [[fallthrough]]
#elif defined(__clang__) #elif defined(__clang__)
@ -285,7 +299,7 @@
// Enable minimal optimizations for more compact code in debug mode. // Enable minimal optimizations for more compact code in debug mode.
FMT_PRAGMA_GCC(push_options) FMT_PRAGMA_GCC(push_options)
#if !defined(__OPTIMIZE__) && !defined(__CUDACC__) #if !defined(__OPTIMIZE__) && !defined(__CUDACC__) && !defined(FMT_MODULE)
FMT_PRAGMA_GCC(optimize("Og")) FMT_PRAGMA_GCC(optimize("Og"))
#endif #endif
FMT_PRAGMA_CLANG(diagnostic push) FMT_PRAGMA_CLANG(diagnostic push)
@ -725,13 +739,15 @@ class basic_specs {
max_fill_size = 4 max_fill_size = 4
}; };
size_t data_ = 1 << fill_size_shift; unsigned data_ = 1 << fill_size_shift;
static_assert(sizeof(data_) * CHAR_BIT >= 18, "");
// Character (code unit) type is erased to prevent template bloat. // Character (code unit) type is erased to prevent template bloat.
char fill_data_[max_fill_size] = {' '}; char fill_data_[max_fill_size] = {' '};
FMT_CONSTEXPR void set_fill_size(size_t size) { FMT_CONSTEXPR void set_fill_size(size_t size) {
data_ = (data_ & ~fill_size_mask) | (size << fill_size_shift); data_ = (data_ & ~fill_size_mask) |
(static_cast<unsigned>(size) << fill_size_shift);
} }
public: public:
@ -828,6 +844,12 @@ class basic_specs {
for (size_t i = 0; i < size; ++i) for (size_t i = 0; i < size; ++i)
fill_data_[i & 3] = static_cast<char>(s[i]); fill_data_[i & 3] = static_cast<char>(s[i]);
} }
FMT_CONSTEXPR void copy_fill_from(const basic_specs& specs) {
set_fill_size(specs.fill_size());
for (size_t i = 0; i < max_fill_size; ++i)
fill_data_[i] = specs.fill_data_[i];
}
}; };
// Format specifiers for built-in and string types. // Format specifiers for built-in and string types.
@ -1099,7 +1121,7 @@ using use_formatter =
bool_constant<(std::is_class<T>::value || std::is_enum<T>::value || bool_constant<(std::is_class<T>::value || std::is_enum<T>::value ||
std::is_union<T>::value || std::is_array<T>::value) && std::is_union<T>::value || std::is_array<T>::value) &&
!has_to_string_view<T>::value && !is_named_arg<T>::value && !has_to_string_view<T>::value && !is_named_arg<T>::value &&
!use_format_as<T>::value && !use_format_as_member<T>::value>; !use_format_as<T>::value && !use_format_as_member<U>::value>;
template <typename Char, typename T, typename U = remove_const_t<T>> template <typename Char, typename T, typename U = remove_const_t<T>>
auto has_formatter_impl(T* p, buffered_context<Char>* ctx = nullptr) auto has_formatter_impl(T* p, buffered_context<Char>* ctx = nullptr)
@ -2256,9 +2278,7 @@ struct locale_ref {
public: public:
constexpr locale_ref() : locale_(nullptr) {} constexpr locale_ref() : locale_(nullptr) {}
template <typename Locale> locale_ref(const Locale& loc);
template <typename Locale, FMT_ENABLE_IF(sizeof(Locale::collate) != 0)>
locale_ref(const Locale& loc);
inline explicit operator bool() const noexcept { return locale_ != nullptr; } inline explicit operator bool() const noexcept { return locale_ != nullptr; }
#endif // FMT_USE_LOCALE #endif // FMT_USE_LOCALE
@ -2604,10 +2624,11 @@ template <typename Context> class basic_format_args {
}; };
// A formatting context. // A formatting context.
class context : private detail::locale_ref { class context {
private: private:
appender out_; appender out_;
format_args args_; format_args args_;
FMT_NO_UNIQUE_ADDRESS detail::locale_ref loc_;
public: public:
/// The character type for the output. /// The character type for the output.
@ -2623,7 +2644,7 @@ class context : private detail::locale_ref {
/// in the object so make sure they have appropriate lifetimes. /// in the object so make sure they have appropriate lifetimes.
FMT_CONSTEXPR context(iterator out, format_args args, FMT_CONSTEXPR context(iterator out, format_args args,
detail::locale_ref loc = {}) detail::locale_ref loc = {})
: locale_ref(loc), out_(out), args_(args) {} : out_(out), args_(args), loc_(loc) {}
context(context&&) = default; context(context&&) = default;
context(const context&) = delete; context(const context&) = delete;
void operator=(const context&) = delete; void operator=(const context&) = delete;
@ -2635,6 +2656,7 @@ class context : private detail::locale_ref {
FMT_CONSTEXPR auto arg_id(string_view name) const -> int { FMT_CONSTEXPR auto arg_id(string_view name) const -> int {
return args_.get_id(name); return args_.get_id(name);
} }
auto args() const -> const format_args& { return args_; }
// Returns an iterator to the beginning of the output range. // Returns an iterator to the beginning of the output range.
FMT_CONSTEXPR auto out() const -> iterator { return out_; } FMT_CONSTEXPR auto out() const -> iterator { return out_; }
@ -2642,7 +2664,7 @@ class context : private detail::locale_ref {
// Advances the begin iterator to `it`. // Advances the begin iterator to `it`.
FMT_CONSTEXPR void advance_to(iterator) {} FMT_CONSTEXPR void advance_to(iterator) {}
FMT_CONSTEXPR auto locale() const -> detail::locale_ref { return *this; } FMT_CONSTEXPR auto locale() const -> detail::locale_ref { return loc_; }
}; };
template <typename Char = char> struct runtime_format_string { template <typename Char = char> struct runtime_format_string {
@ -2659,7 +2681,8 @@ template <typename Char = char> struct runtime_format_string {
*/ */
inline auto runtime(string_view s) -> runtime_format_string<> { return {{s}}; } inline auto runtime(string_view s) -> runtime_format_string<> { return {{s}}; }
/// A compile-time format string. /// A compile-time format string. Use `format_string` in the public API to
/// prevent type deduction.
template <typename... T> struct fstring { template <typename... T> struct fstring {
private: private:
static constexpr int num_static_named_args = static constexpr int num_static_named_args =

View file

@ -261,7 +261,7 @@ namespace detail {
using utc_clock = std::chrono::utc_clock; using utc_clock = std::chrono::utc_clock;
#else #else
struct utc_clock { struct utc_clock {
void to_sys(); template <typename T> void to_sys(T);
}; };
#endif #endif
@ -364,7 +364,7 @@ void write_codecvt(codecvt_result<CodeUnit>& out, string_view in,
template <typename OutputIt> template <typename OutputIt>
auto write_encoded_tm_str(OutputIt out, string_view in, const std::locale& loc) auto write_encoded_tm_str(OutputIt out, string_view in, const std::locale& loc)
-> OutputIt { -> OutputIt {
if (detail::use_utf8 && loc != get_classic_locale()) { if (const_check(detail::use_utf8) && loc != get_classic_locale()) {
// char16_t and char32_t codecvts are broken in MSVC (linkage errors) and // char16_t and char32_t codecvts are broken in MSVC (linkage errors) and
// gcc-4. // gcc-4.
#if FMT_MSC_VERSION != 0 || \ #if FMT_MSC_VERSION != 0 || \

View file

@ -84,7 +84,7 @@ using std::locale;
using std::numpunct; using std::numpunct;
using std::use_facet; using std::use_facet;
template <typename Locale, enable_if_t<(sizeof(Locale::collate) != 0), int>> template <typename Locale>
locale_ref::locale_ref(const Locale& loc) : locale_(&loc) { locale_ref::locale_ref(const Locale& loc) : locale_(&loc) {
static_assert(std::is_same<Locale, locale>::value, ""); static_assert(std::is_same<Locale, locale>::value, "");
} }
@ -134,7 +134,9 @@ FMT_FUNC auto write_loc(appender out, loc_value value,
FMT_FUNC void report_error(const char* message) { FMT_FUNC void report_error(const char* message) {
#if FMT_USE_EXCEPTIONS #if FMT_USE_EXCEPTIONS
throw format_error(message); // Use FMT_THROW instead of throw to avoid bogus unreachable code warnings
// from MSVC.
FMT_THROW(format_error(message));
#else #else
fputs(message, stderr); fputs(message, stderr);
abort(); abort();

View file

@ -151,20 +151,6 @@ FMT_END_NAMESPACE
# endif // FMT_USE_EXCEPTIONS # endif // FMT_USE_EXCEPTIONS
#endif // FMT_THROW #endif // FMT_THROW
#ifdef FMT_NO_UNIQUE_ADDRESS
// Use the provided definition.
#elif FMT_CPLUSPLUS < 202002L
// Not supported.
#elif FMT_HAS_CPP_ATTRIBUTE(no_unique_address)
# define FMT_NO_UNIQUE_ADDRESS [[no_unique_address]]
// VS2019 v16.10 and later except clang-cl (https://reviews.llvm.org/D110485).
#elif FMT_MSC_VERSION >= 1929 && !FMT_CLANG_VERSION
# define FMT_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#endif
#ifndef FMT_NO_UNIQUE_ADDRESS
# define FMT_NO_UNIQUE_ADDRESS
#endif
// Defining FMT_REDUCE_INT_INSTANTIATIONS to 1, will reduce the number of // Defining FMT_REDUCE_INT_INSTANTIATIONS to 1, will reduce the number of
// integer formatter template instantiations to just one by only using the // integer formatter template instantiations to just one by only using the
// largest integer type. This results in a reduction in binary size but will // largest integer type. This results in a reduction in binary size but will
@ -241,7 +227,9 @@ FMT_CONSTEXPR inline void abort_fuzzing_if(bool condition) {
#if defined(FMT_USE_STRING_VIEW) #if defined(FMT_USE_STRING_VIEW)
template <typename Char> using std_string_view = std::basic_string_view<Char>; template <typename Char> using std_string_view = std::basic_string_view<Char>;
#else #else
template <typename T> struct std_string_view {}; template <typename Char> struct std_string_view {
operator basic_string_view<Char>() const;
};
#endif #endif
template <typename Char, Char... C> struct string_literal { template <typename Char, Char... C> struct string_literal {
@ -1217,7 +1205,7 @@ FMT_CONSTEXPR FMT_INLINE auto format_decimal(Char* out, UInt value,
} }
template <typename Char, typename UInt, typename OutputIt, template <typename Char, typename UInt, typename OutputIt,
FMT_ENABLE_IF(is_back_insert_iterator<OutputIt>::value)> FMT_ENABLE_IF(!std::is_pointer<remove_cvref_t<OutputIt>>::value)>
FMT_CONSTEXPR auto format_decimal(OutputIt out, UInt value, int num_digits) FMT_CONSTEXPR auto format_decimal(OutputIt out, UInt value, int num_digits)
-> OutputIt { -> OutputIt {
if (auto ptr = to_pointer<Char>(out, to_unsigned(num_digits))) { if (auto ptr = to_pointer<Char>(out, to_unsigned(num_digits))) {
@ -1853,7 +1841,9 @@ template <typename Char> class digit_grouping {
} }
public: public:
explicit digit_grouping(locale_ref loc, bool localized = true) { template <typename Locale,
FMT_ENABLE_IF(std::is_same<Locale, locale_ref>::value)>
explicit digit_grouping(Locale loc, bool localized = true) {
if (!localized) return; if (!localized) return;
auto sep = thousands_sep<Char>(loc); auto sep = thousands_sep<Char>(loc);
grouping_ = sep.grouping; grouping_ = sep.grouping;
@ -3653,6 +3643,12 @@ FMT_CONSTEXPR auto native_formatter<T, Char, TYPE>::format(
return write<Char>(ctx.out(), val, specs, ctx.locale()); return write<Char>(ctx.out(), val, specs, ctx.locale());
} }
// DEPRECATED! https://github.com/fmtlib/fmt/issues/4292.
template <typename T, typename Enable = void>
struct is_locale : std::false_type {};
template <typename T>
struct is_locale<T, void_t<decltype(T::classic())>> : std::true_type {};
// DEPRECATED! // DEPRECATED!
template <typename Char = char> struct vformat_args { template <typename Char = char> struct vformat_args {
using type = basic_format_args<buffered_context<Char>>; using type = basic_format_args<buffered_context<Char>>;
@ -3974,8 +3970,7 @@ template <typename T, typename Char = char> struct nested_formatter {
write(basic_appender<Char>(buf)); write(basic_appender<Char>(buf));
auto specs = format_specs(); auto specs = format_specs();
specs.width = width_; specs.width = width_;
specs.set_fill( specs.copy_fill_from(specs_);
basic_string_view<Char>(specs_.fill<Char>(), specs_.fill_size()));
specs.set_align(specs_.align()); specs.set_align(specs_.align());
return detail::write<Char>( return detail::write<Char>(
ctx.out(), basic_string_view<Char>(buf.data(), buf.size()), specs); ctx.out(), basic_string_view<Char>(buf.data(), buf.size()), specs);
@ -4135,41 +4130,46 @@ FMT_API void format_system_error(detail::buffer<char>& out, int error_code,
// Can be used to report errors from destructors. // Can be used to report errors from destructors.
FMT_API void report_system_error(int error_code, const char* message) noexcept; FMT_API void report_system_error(int error_code, const char* message) noexcept;
inline auto vformat(detail::locale_ref loc, string_view fmt, format_args args) template <typename Locale, FMT_ENABLE_IF(detail::is_locale<Locale>::value)>
inline auto vformat(const Locale& loc, string_view fmt, format_args args)
-> std::string { -> std::string {
auto buf = memory_buffer(); auto buf = memory_buffer();
detail::vformat_to(buf, fmt, args, loc); detail::vformat_to(buf, fmt, args, detail::locale_ref(loc));
return {buf.data(), buf.size()}; return {buf.data(), buf.size()};
} }
template <typename... T> template <typename Locale, typename... T,
FMT_INLINE auto format(detail::locale_ref loc, format_string<T...> fmt, FMT_ENABLE_IF(detail::is_locale<Locale>::value)>
T&&... args) -> std::string { FMT_INLINE auto format(const Locale& loc, format_string<T...> fmt, T&&... args)
-> std::string {
return vformat(loc, fmt.str, vargs<T...>{{args...}}); return vformat(loc, fmt.str, vargs<T...>{{args...}});
} }
template <typename OutputIt, template <typename OutputIt, typename Locale,
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)> FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)>
auto vformat_to(OutputIt out, detail::locale_ref loc, string_view fmt, auto vformat_to(OutputIt out, const Locale& loc, string_view fmt,
format_args args) -> OutputIt { format_args args) -> OutputIt {
auto&& buf = detail::get_buffer<char>(out); auto&& buf = detail::get_buffer<char>(out);
detail::vformat_to(buf, fmt, args, loc); detail::vformat_to(buf, fmt, args, detail::locale_ref(loc));
return detail::get_iterator(buf, out); return detail::get_iterator(buf, out);
} }
template <typename OutputIt, typename... T, template <typename OutputIt, typename Locale, typename... T,
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)> FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value&&
FMT_INLINE auto format_to(OutputIt out, detail::locale_ref loc, detail::is_locale<Locale>::value)>
FMT_INLINE auto format_to(OutputIt out, const Locale& loc,
format_string<T...> fmt, T&&... args) -> OutputIt { format_string<T...> fmt, T&&... args) -> OutputIt {
return fmt::vformat_to(out, loc, fmt.str, vargs<T...>{{args...}}); return fmt::vformat_to(out, loc, fmt.str, vargs<T...>{{args...}});
} }
template <typename... T> template <typename Locale, typename... T,
FMT_NODISCARD FMT_INLINE auto formatted_size(detail::locale_ref loc, FMT_ENABLE_IF(detail::is_locale<Locale>::value)>
FMT_NODISCARD FMT_INLINE auto formatted_size(const Locale& loc,
format_string<T...> fmt, format_string<T...> fmt,
T&&... args) -> size_t { T&&... args) -> size_t {
auto buf = detail::counting_buffer<>(); auto buf = detail::counting_buffer<>();
detail::vformat_to(buf, fmt.str, vargs<T...>{{args...}}, loc); detail::vformat_to(buf, fmt.str, vargs<T...>{{args...}},
detail::locale_ref(loc));
return buf.count(); return buf.count();
} }

View file

@ -150,7 +150,7 @@ inline void vprint(std::ostream& os, string_view fmt, format_args args) {
FMT_EXPORT template <typename... T> FMT_EXPORT template <typename... T>
void print(std::ostream& os, format_string<T...> fmt, T&&... args) { void print(std::ostream& os, format_string<T...> fmt, T&&... args) {
fmt::vargs<T...> vargs = {{args...}}; fmt::vargs<T...> vargs = {{args...}};
if (detail::use_utf8) return vprint(os, fmt.str, vargs); if (detail::const_check(detail::use_utf8)) return vprint(os, fmt.str, vargs);
auto buffer = memory_buffer(); auto buffer = memory_buffer();
detail::vformat_to(buffer, fmt.str, vargs); detail::vformat_to(buffer, fmt.str, vargs);
detail::write_buffer(os, buffer); detail::write_buffer(os, buffer);

View file

@ -527,7 +527,9 @@ struct formatter<
template <typename R, typename Char> template <typename R, typename Char>
struct formatter< struct formatter<
R, Char, R, Char,
enable_if_t<range_format_kind<R, Char>::value == range_format::map>> { enable_if_t<conjunction<
bool_constant<range_format_kind<R, Char>::value == range_format::map>,
detail::is_formattable_delayed<R, Char>>::value>> {
private: private:
using map_type = detail::maybe_const_range<R>; using map_type = detail::maybe_const_range<R>;
using element_type = detail::uncvref_type<map_type>; using element_type = detail::uncvref_type<map_type>;

View file

@ -184,7 +184,8 @@ FMT_END_NAMESPACE
FMT_BEGIN_NAMESPACE FMT_BEGIN_NAMESPACE
FMT_EXPORT FMT_EXPORT
template <std::size_t N, typename Char> template <std::size_t N, typename Char>
struct formatter<std::bitset<N>, Char> : nested_formatter<string_view> { struct formatter<std::bitset<N>, Char>
: nested_formatter<basic_string_view<Char>, Char> {
private: private:
// Functor because C++11 doesn't support generic lambdas. // Functor because C++11 doesn't support generic lambdas.
struct writer { struct writer {
@ -204,7 +205,7 @@ struct formatter<std::bitset<N>, Char> : nested_formatter<string_view> {
template <typename FormatContext> template <typename FormatContext>
auto format(const std::bitset<N>& bs, FormatContext& ctx) const auto format(const std::bitset<N>& bs, FormatContext& ctx) const
-> decltype(ctx.out()) { -> decltype(ctx.out()) {
return write_padded(ctx, writer{bs}); return this->write_padded(ctx, writer{bs});
} }
}; };
@ -695,9 +696,7 @@ template <typename T, typename Char> struct formatter<std::complex<T>, Char> {
auto outer_specs = format_specs(); auto outer_specs = format_specs();
outer_specs.width = specs.width; outer_specs.width = specs.width;
auto fill = specs.template fill<Char>(); outer_specs.copy_fill_from(specs);
if (fill)
outer_specs.set_fill(basic_string_view<Char>(fill, specs.fill_size()));
outer_specs.set_align(specs.align()); outer_specs.set_align(specs.align());
specs.width = 0; specs.width = 0;

View file

@ -191,9 +191,11 @@ auto format(const S& fmt, T&&... args) -> std::basic_string<Char> {
fmt::make_format_args<buffered_context<Char>>(args...)); fmt::make_format_args<buffered_context<Char>>(args...));
} }
template <typename S, typename Char = detail::format_string_char_t<S>, template <typename Locale, typename S,
FMT_ENABLE_IF(detail::is_exotic_char<Char>::value)> typename Char = detail::format_string_char_t<S>,
inline auto vformat(detail::locale_ref loc, const S& fmt, FMT_ENABLE_IF(detail::is_locale<Locale>::value&&
detail::is_exotic_char<Char>::value)>
inline auto vformat(const Locale& loc, const S& fmt,
typename detail::vformat_args<Char>::type args) typename detail::vformat_args<Char>::type args)
-> std::basic_string<Char> { -> std::basic_string<Char> {
auto buf = basic_memory_buffer<Char>(); auto buf = basic_memory_buffer<Char>();
@ -202,10 +204,11 @@ inline auto vformat(detail::locale_ref loc, const S& fmt,
return {buf.data(), buf.size()}; return {buf.data(), buf.size()};
} }
template <typename S, typename... T, template <typename Locale, typename S, typename... T,
typename Char = detail::format_string_char_t<S>, typename Char = detail::format_string_char_t<S>,
FMT_ENABLE_IF(detail::is_exotic_char<Char>::value)> FMT_ENABLE_IF(detail::is_locale<Locale>::value&&
inline auto format(detail::locale_ref loc, const S& fmt, T&&... args) detail::is_exotic_char<Char>::value)>
inline auto format(const Locale& loc, const S& fmt, T&&... args)
-> std::basic_string<Char> { -> std::basic_string<Char> {
return vformat(loc, detail::to_string_view(fmt), return vformat(loc, detail::to_string_view(fmt),
fmt::make_format_args<buffered_context<Char>>(args...)); fmt::make_format_args<buffered_context<Char>>(args...));
@ -232,11 +235,12 @@ inline auto format_to(OutputIt out, const S& fmt, T&&... args) -> OutputIt {
fmt::make_format_args<buffered_context<Char>>(args...)); fmt::make_format_args<buffered_context<Char>>(args...));
} }
template <typename S, typename OutputIt, typename... Args, template <typename Locale, typename S, typename OutputIt, typename... Args,
typename Char = detail::format_string_char_t<S>, typename Char = detail::format_string_char_t<S>,
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&& FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
detail::is_locale<Locale>::value&&
detail::is_exotic_char<Char>::value)> detail::is_exotic_char<Char>::value)>
inline auto vformat_to(OutputIt out, detail::locale_ref loc, const S& fmt, inline auto vformat_to(OutputIt out, const Locale& loc, const S& fmt,
typename detail::vformat_args<Char>::type args) typename detail::vformat_args<Char>::type args)
-> OutputIt { -> OutputIt {
auto&& buf = detail::get_buffer<Char>(out); auto&& buf = detail::get_buffer<Char>(out);
@ -244,11 +248,12 @@ inline auto vformat_to(OutputIt out, detail::locale_ref loc, const S& fmt,
return detail::get_iterator(buf, out); return detail::get_iterator(buf, out);
} }
template <typename OutputIt, typename S, typename... T, template <typename Locale, typename OutputIt, typename S, typename... T,
typename Char = detail::format_string_char_t<S>, typename Char = detail::format_string_char_t<S>,
bool enable = detail::is_output_iterator<OutputIt, Char>::value && bool enable = detail::is_output_iterator<OutputIt, Char>::value &&
detail::is_locale<Locale>::value &&
detail::is_exotic_char<Char>::value> detail::is_exotic_char<Char>::value>
inline auto format_to(OutputIt out, detail::locale_ref loc, const S& fmt, inline auto format_to(OutputIt out, const Locale& loc, const S& fmt,
T&&... args) -> T&&... args) ->
typename std::enable_if<enable, OutputIt>::type { typename std::enable_if<enable, OutputIt>::type {
return vformat_to(out, loc, detail::to_string_view(fmt), return vformat_to(out, loc, detail::to_string_view(fmt),