diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 9abe7c4f..284c6e86 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -8,14 +8,14 @@ #ifndef FMT_CHRONO_H_ #define FMT_CHRONO_H_ -#include "format.h" -#include "locale.h" - #include #include #include #include +#include "format.h" +#include "locale.h" + FMT_BEGIN_NAMESPACE // Enable safe chrono durations, unless explicitly disabled. @@ -1038,8 +1038,11 @@ struct formatter, Char> { using iterator = typename basic_format_parse_context::iterator; struct parse_range { - iterator begin; - iterator end; + iterator first; + iterator last; + + iterator begin() const { return first; } + iterator end() const { return last; } }; FMT_CONSTEXPR parse_range do_parse(basic_format_parse_context& ctx) { @@ -1067,8 +1070,8 @@ struct formatter, Char> { -> decltype(ctx.begin()) { auto range = do_parse(ctx); format_str = basic_string_view( - &*range.begin, internal::to_unsigned(range.end - range.begin)); - return range.end; + &*range.begin(), internal::to_unsigned(range.end() - range.begin())); + return range.end(); } template