@@ -4136,33 +4136,37 @@ template <typename T> struct formatter<group_digits_view<T>> : formatter<T> {
4136
4136
}
4137
4137
};
4138
4138
4139
- template <typename T> struct nested_view {
4140
- const formatter<T>* fmt;
4139
+ template <typename T, typename Char > struct nested_view {
4140
+ const formatter<T, Char >* fmt;
4141
4141
const T* value;
4142
4142
};
4143
4143
4144
- template <typename T> struct formatter <nested_view<T>> {
4145
- FMT_CONSTEXPR auto parse (format_parse_context& ctx) -> const char* {
4144
+ template <typename T, typename Char>
4145
+ struct formatter <nested_view<T, Char>, Char> {
4146
+ template <typename ParseContext>
4147
+ FMT_CONSTEXPR auto parse (ParseContext& ctx) -> decltype(ctx.begin()) {
4146
4148
return ctx.begin ();
4147
4149
}
4148
- auto format (nested_view<T> view, format_context& ctx) const
4150
+ template <typename FormatContext>
4151
+ auto format (nested_view<T, Char> view, FormatContext& ctx) const
4149
4152
-> decltype(ctx.out()) {
4150
4153
return view.fmt ->format (*view.value , ctx);
4151
4154
}
4152
4155
};
4153
4156
4154
- template <typename T> struct nested_formatter {
4157
+ template <typename T, typename Char = char > struct nested_formatter {
4155
4158
private:
4156
4159
int width_;
4157
4160
detail::fill_t fill_;
4158
4161
align_t align_ : 4 ;
4159
- formatter<T> formatter_;
4162
+ formatter<T, Char > formatter_;
4160
4163
4161
4164
public:
4162
4165
constexpr nested_formatter () : width_(0 ), align_(align_t ::none) {}
4163
4166
4164
- FMT_CONSTEXPR auto parse (format_parse_context& ctx) -> const char* {
4165
- auto specs = detail::dynamic_format_specs<char >();
4167
+ FMT_CONSTEXPR auto parse (basic_format_parse_context<Char>& ctx)
4168
+ -> decltype(ctx.begin()) {
4169
+ auto specs = detail::dynamic_format_specs<Char>();
4166
4170
auto it = parse_format_specs (ctx.begin (), ctx.end (), specs, ctx,
4167
4171
detail::type::none_type);
4168
4172
width_ = specs.width ;
@@ -4172,21 +4176,21 @@ template <typename T> struct nested_formatter {
4172
4176
return formatter_.parse (ctx);
4173
4177
}
4174
4178
4175
- template <typename F>
4176
- auto write_padded (format_context & ctx, F write) const -> decltype(ctx.out()) {
4179
+ template <typename FormatContext, typename F>
4180
+ auto write_padded (FormatContext & ctx, F write) const -> decltype(ctx.out()) {
4177
4181
if (width_ == 0 ) return write (ctx.out ());
4178
- auto buf = memory_buffer ();
4179
- write (appender (buf));
4182
+ auto buf = basic_memory_buffer<Char> ();
4183
+ write (basic_appender<Char> (buf));
4180
4184
auto specs = format_specs ();
4181
4185
specs.width = width_;
4182
4186
specs.fill = fill_;
4183
4187
specs.align = align_;
4184
- return detail::write <char >(ctx. out (), string_view (buf. data (), buf. size ()),
4185
- specs);
4188
+ return detail::write <Char>(
4189
+ ctx. out (), basic_string_view<Char>(buf. data (), buf. size ()), specs);
4186
4190
}
4187
4191
4188
- auto nested (const T& value) const -> nested_view<T> {
4189
- return nested_view<T>{&formatter_, &value};
4192
+ auto nested (const T& value) const -> nested_view<T, Char > {
4193
+ return nested_view<T, Char >{&formatter_, &value};
4190
4194
}
4191
4195
};
4192
4196
0 commit comments