From 3e04222d53e683f60a4ad79016a9c6d82186bbb5 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 26 Dec 2024 10:44:57 -0800 Subject: [PATCH] Restore ABI compatibility with 11.0.2 --- include/fmt/base.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 8a4e8818..ab2fcf6f 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -2604,10 +2604,11 @@ template class basic_format_args { }; // A formatting context. -class context : private detail::locale_ref { +class context { private: appender out_; format_args args_; + detail::locale_ref loc_; // DEPRECATED! Should be replaced with a base class. public: /// The character type for the output. @@ -2623,7 +2624,7 @@ class context : private detail::locale_ref { /// in the object so make sure they have appropriate lifetimes. FMT_CONSTEXPR context(iterator out, format_args args, detail::locale_ref loc = {}) - : locale_ref(loc), out_(out), args_(args) {} + : out_(out), args_(args), loc_(loc) {} context(context&&) = default; context(const context&) = delete; void operator=(const context&) = delete; @@ -2642,7 +2643,7 @@ class context : private detail::locale_ref { // Advances the begin iterator to `it`. 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 struct runtime_format_string {