Refactor format_specs for #1109 and #940

Refactor `format_specs` and related APIs to support variable-width fill
(#1109), improve naming consistency, remove legacy setters (#940), and
optimize layout.
This commit is contained in:
Victor Zverovich
2019-07-06 17:57:57 -07:00
parent 8e0dcd20b3
commit e4f84ee1c6
8 changed files with 195 additions and 176 deletions

View File

@@ -690,7 +690,7 @@ struct formatter {
template <typename FormatContext>
auto format(const T& val, FormatContext& ctx) -> decltype(ctx.out()) {
fmt::internal::handle_dynamic_spec<fmt::internal::width_checker>(
specs_.width_, specs_.width_ref, ctx, nullptr);
specs_.width, specs_.width_ref, ctx, nullptr);
fmt::internal::handle_dynamic_spec<fmt::internal::precision_checker>(
specs_.precision, specs_.precision_ref, ctx, nullptr);
using range_type = fmt::internal::output_range<typename FormatContext::iterator,