Replace Range with ParseContext in parse()

This commit is contained in:
Victor Zverovich
2017-09-16 16:50:40 -07:00
parent 83dd2ab919
commit ec4f5175f1
4 changed files with 48 additions and 36 deletions

View File

@@ -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 &) {

View File

@@ -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) {