fix: make std::bitset formattable again (#3660)

* fix: make std::bitset formattable again

It used to be formattable via operator<<(ostream&) implicitly. Make it
formattable again, but this time via formatter specialization.

* fix: make nested_formatter constexpr default constructible
This commit is contained in:
Giel van Schijndel
2023-10-03 18:53:47 +02:00
committed by GitHub
parent f918289363
commit f76603f21e
3 changed files with 36 additions and 0 deletions

View File

@@ -4215,6 +4215,8 @@ template <typename T> struct nested_formatter {
formatter<T> formatter_;
public:
constexpr nested_formatter() : width_(0), align_(align_t::none) {}
FMT_CONSTEXPR auto parse(format_parse_context& ctx) -> const char* {
auto specs = detail::dynamic_format_specs<char>();
auto it = parse_format_specs(ctx.begin(), ctx.end(), specs, ctx,