Skip to content

Commit

Permalink
Workaround an issue with mixing std versions in gcc (#2017)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Nov 14, 2020
1 parent 5555651 commit 3a4c74a
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,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(' ')};
unsigned char size_ = 1;

public:
FMT_CONSTEXPR void operator=(basic_string_view<Char> s) {
Expand All @@ -1195,13 +1195,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

Expand Down Expand Up @@ -1233,8 +1226,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>;
Expand Down

0 comments on commit 3a4c74a

Please sign in to comment.