From 5ff22d44be75d54bf7f2006a4b527f675ea3c935 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 6 Mar 2013 19:03:43 +0100 Subject: [PATCH] Add utf8_iterator::advance(CharCount, utf8_iterator end) --- src/utf8_iterator.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utf8_iterator.hh b/src/utf8_iterator.hh index 464aff3a..71681dcc 100644 --- a/src/utf8_iterator.hh +++ b/src/utf8_iterator.hh @@ -33,6 +33,12 @@ public: return save; } + void advance(CharCount count, const utf8_iterator& end) + { + while (*this != end and count-- > 0) + ++*this; + } + utf8_iterator& operator--() { m_it = utf8::previous(m_it);