Skip to content

Commit

Permalink
Remove nonstandard alias
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jan 13, 2024
1 parent 4d766b1 commit cacdf14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -1882,15 +1882,14 @@ class context {

using iterator = appender;
using format_arg = basic_format_arg<context>;
using format_args = basic_format_args<context>;
using parse_context_type = basic_format_parse_context<char>;
template <typename T> using formatter_type = formatter<T, char>;

/**
Constructs a ``basic_format_context`` object. References to the arguments
are stored in the object so make sure they have appropriate lifetimes.
*/
FMT_CONSTEXPR context(iterator out, format_args ctx_args,
FMT_CONSTEXPR context(iterator out, basic_format_args<context> ctx_args,
detail::locale_ref loc = {})
: out_(out), args_(ctx_args), loc_(loc) {}
context(context&&) = default;
Expand All @@ -1902,7 +1901,7 @@ class context {
FMT_CONSTEXPR auto arg_id(string_view name) -> int {
return args_.get_id(name);
}
auto args() const -> const format_args& { return args_; }
auto args() const -> const basic_format_args<context>& { return args_; }

// This function is intentionally not constexpr to give a compile-time error.
void on_error(const char* message) { throw_format_error(message); }
Expand Down
8 changes: 5 additions & 3 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1020,11 +1020,11 @@ template <typename OutputIt, typename Char> class generic_context {
public:
using char_type = Char;
using iterator = OutputIt;
using format_args = basic_format_args<generic_context>;
using parse_context_type = basic_format_parse_context<Char>;
template <typename T> using formatter_type = formatter<T, Char>;

constexpr generic_context(OutputIt out, format_args ctx_args,
constexpr generic_context(OutputIt out,
basic_format_args<generic_context> ctx_args,
detail::locale_ref loc = {})
: out_(out), args_(ctx_args), loc_(loc) {}
generic_context(generic_context&&) = default;
Expand All @@ -1040,7 +1040,9 @@ template <typename OutputIt, typename Char> class generic_context {
FMT_CONSTEXPR auto arg_id(basic_string_view<Char> name) -> int {
return args_.get_id(name);
}
auto args() const -> const format_args& { return args_; }
auto args() const -> const basic_format_args<generic_context>& {
return args_;
}

void on_error(const char* message) { throw_format_error(message); }

Expand Down

0 comments on commit cacdf14

Please sign in to comment.