mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-03 07:31:41 +01:00
Replace Range with ParseContext in parse()
This commit is contained in:
@@ -1233,9 +1233,9 @@ TEST(FormatterTest, FormatStringView) {
|
||||
namespace fmt {
|
||||
template <>
|
||||
struct formatter<Date> {
|
||||
template <typename Range>
|
||||
auto parse(Range format) -> decltype(begin(format)) {
|
||||
return begin(format);
|
||||
template <typename ParseContext>
|
||||
auto parse(ParseContext &ctx) -> decltype(ctx.begin()) {
|
||||
return ctx.begin();
|
||||
}
|
||||
|
||||
void format(buffer &buf, const Date &d, context &) {
|
||||
|
||||
@@ -75,9 +75,9 @@ basic_arg<Context> make_arg(const T &value) {
|
||||
namespace fmt {
|
||||
template <typename Char>
|
||||
struct formatter<Test, Char> {
|
||||
template <typename Range>
|
||||
auto parse(Range format) -> decltype(begin(format)) {
|
||||
return begin(format);
|
||||
template <typename ParseContext>
|
||||
auto parse(ParseContext &ctx) -> decltype(ctx.begin()) {
|
||||
return ctx.begin();
|
||||
}
|
||||
|
||||
void format(basic_buffer<Char> &b, Test, basic_context<Char> &) {
|
||||
@@ -436,9 +436,9 @@ struct CustomContext {
|
||||
|
||||
template <typename T>
|
||||
struct formatter_type {
|
||||
template <typename Range>
|
||||
auto parse(Range range) -> decltype(begin(range)) {
|
||||
return begin(range);
|
||||
template <typename ParseContext>
|
||||
auto parse(ParseContext &ctx) -> decltype(ctx.begin()) {
|
||||
return ctx.begin();
|
||||
}
|
||||
|
||||
void format(fmt::buffer &, const T &, CustomContext& ctx) {
|
||||
|
||||
Reference in New Issue
Block a user