diff options
author | Victor Zverovich <victor.zverovich@gmail.com> | 2020-11-14 09:02:14 -0800 |
---|---|---|
committer | Victor Zverovich <victor.zverovich@gmail.com> | 2020-11-24 08:21:10 -0800 |
commit | df66516ed35c1a22231f283cc8e4a2dbc8d57c13 (patch) | |
tree | 2daec67a72aa2befb9a06aefa045cd2f18545aa7 /include/fmt | |
parent | a57baa69a589115e4130e8520ff5348fdb2ae4a7 (diff) | |
download | fmtlib-df66516ed35c1a22231f283cc8e4a2dbc8d57c13.tar.gz |
Workaround an issue with mixing std versions in gcc (#2017)
Diffstat (limited to 'include/fmt')
-rw-r--r-- | include/fmt/format.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/include/fmt/format.h b/include/fmt/format.h index b967afea..1a037b02 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1145,8 +1145,8 @@ template <typename T = void> struct null {}; template <typename Char> struct fill_t { private: enum { max_size = 4 }; - Char data_[max_size]; - unsigned char size_; + Char data_[max_size] = {Char(' '), Char(0), Char(0), Char(0)}; + unsigned char size_ = 1; public: FMT_CONSTEXPR void operator=(basic_string_view<Char> s) { @@ -1166,13 +1166,6 @@ template <typename Char> struct fill_t { FMT_CONSTEXPR const Char& operator[](size_t index) const { return data_[index]; } - - static FMT_CONSTEXPR fill_t<Char> make() { - auto fill = fill_t<Char>(); - fill[0] = Char(' '); - fill.size_ = 1; - return fill; - } }; } // namespace detail @@ -1204,8 +1197,7 @@ template <typename Char> struct basic_format_specs { type(0), align(align::none), sign(sign::none), - alt(false), - fill(detail::fill_t<Char>::make()) {} + alt(false) {} }; using format_specs = basic_format_specs<char>; |