From be5b4552d97e8d578cfe6fc0d83802bac857f6d6 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 27 Sep 2017 22:40:58 -0700 Subject: [PATCH] Make null_terminating_iterator more iteratory --- fmt/format.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fmt/format.h b/fmt/format.h index 5c527a4e..877105bd 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -769,8 +769,11 @@ const Char *pointer_from(null_terminating_iterator it); template class null_terminating_iterator { public: - typedef Char value_type; - typedef std::ptrdiff_t difference_type; + using difference_type = std::ptrdiff_t; + using value_type = Char; + using pointer = const Char*; + using reference = const Char&; + using iterator_category = std::random_access_iterator_tag; null_terminating_iterator() : ptr_(0), end_(0) {} @@ -3314,7 +3317,7 @@ class dynamic_specs_handler : template Iterator parse_arg_id(Iterator it, Handler handler) { - typedef typename Iterator::value_type char_type; + using char_type = typename std::iterator_traits::value_type; char_type c = *it; if (c == '}' || c == ':') { handler();