From 3a4c74aa49734dd4e84c862124f8de56722408ab Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 14 Nov 2020 09:02:14 -0800 Subject: [PATCH] Workaround an issue with mixing std versions in gcc (#2017) --- include/fmt/format.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index b8b64a30f02ca..6a6eadad7a75e 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1174,8 +1174,8 @@ template struct null {}; template struct fill_t { private: enum { max_size = 4 }; - Char data_[max_size]; - unsigned char size_; + Char data_[max_size] = {Char(' ')}; + unsigned char size_ = 1; public: FMT_CONSTEXPR void operator=(basic_string_view s) { @@ -1195,13 +1195,6 @@ template struct fill_t { FMT_CONSTEXPR const Char& operator[](size_t index) const { return data_[index]; } - - static FMT_CONSTEXPR fill_t make() { - auto fill = fill_t(); - fill[0] = Char(' '); - fill.size_ = 1; - return fill; - } }; } // namespace detail @@ -1233,8 +1226,7 @@ template struct basic_format_specs { type(0), align(align::none), sign(sign::none), - alt(false), - fill(detail::fill_t::make()) {} + alt(false) {} }; using format_specs = basic_format_specs;