diff --git a/include/fmt/format.h b/include/fmt/format.h index f2179da3..8af59b7f 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3084,9 +3084,9 @@ struct format_handler : internal::error_handler { void on_arg_id() { arg = context.next_arg(); } void on_arg_id(unsigned id) { context.parse_context().check_arg_id(id); - arg = context.get_arg(id); + arg = context.arg(id); } - void on_arg_id(basic_string_view id) { arg = context.get_arg(id); } + void on_arg_id(basic_string_view id) { arg = context.arg(id); } void on_replacement_field(const Char* p) { context.parse_context().advance_to(p); diff --git a/include/fmt/prepare.h b/include/fmt/prepare.h index 3569bec0..5b0434d8 100644 --- a/include/fmt/prepare.h +++ b/include/fmt/prepare.h @@ -284,8 +284,8 @@ class prepared_format { const auto arg = value.spec.arg_id.which == format_part_t::argument_id::which_arg_id::index - ? ctx.get_arg(arg_id_value.index) - : ctx.get_arg(arg_id_value.named_index.to_view(format_)); + ? ctx.arg(arg_id_value.index) + : ctx.arg(arg_id_value.named_index.to_view(format_)); auto specs = value.spec.parsed_specs; @@ -317,7 +317,7 @@ class prepared_format { void format_arg(Context& ctx, Id arg_id) const { ctx.parse_context().check_arg_id(arg_id); const auto stopped_at = - visit_format_arg(arg_formatter(ctx), ctx.get_arg(arg_id)); + visit_format_arg(arg_formatter(ctx), ctx.arg(arg_id)); ctx.advance_to(stopped_at); } diff --git a/test/core-test.cc b/test/core-test.cc index f5373ac1..883a7983 100644 --- a/test/core-test.cc +++ b/test/core-test.cc @@ -290,13 +290,13 @@ VISIT_TYPE(unsigned long, unsigned long long); VISIT_TYPE(float, double); -#define CHECK_ARG_(Char, expected, value) \ - { \ - testing::StrictMock> visitor; \ - EXPECT_CALL(visitor, visit(expected)); \ - typedef std::back_insert_iterator> iterator; \ - fmt::visit(visitor, \ - make_arg>(value)); \ +#define CHECK_ARG_(Char, expected, value) \ + { \ + testing::StrictMock> visitor; \ + EXPECT_CALL(visitor, visit(expected)); \ + typedef std::back_insert_iterator> iterator; \ + fmt::visit_format_arg( \ + visitor, make_arg>(value)); \ } #define CHECK_ARG(value, typename_) \ @@ -391,14 +391,14 @@ TEST(ArgTest, CustomArg) { visitor; testing::StrictMock v; EXPECT_CALL(v, visit(_)).WillOnce(testing::Invoke(check_custom())); - fmt::visit(v, make_arg(test)); + fmt::visit_format_arg(v, make_arg(test)); } TEST(ArgTest, VisitInvalidArg) { testing::StrictMock> visitor; EXPECT_CALL(visitor, visit(_)); fmt::basic_format_arg arg; - visit(visitor, arg); + fmt::visit_format_arg(visitor, arg); } TEST(StringViewTest, Length) {