From adaf6ecc40d91389783e01bd3ac8bca8579f3d28 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 29 Mar 2015 20:03:09 +0100 Subject: [PATCH] Move skip_while helpers to selectors.hh --- src/selectors.hh | 14 ++++++++++++++ src/utils.hh | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/selectors.hh b/src/selectors.hh index 41c7bc96..4ca23030 100644 --- a/src/selectors.hh +++ b/src/selectors.hh @@ -18,6 +18,20 @@ inline Selection keep_direction(Selection res, const Selection& ref) return res; } +template +void skip_while(Iterator& it, const EndIterator& end, T condition) +{ + while (it != end and condition(*it)) + ++it; +} + +template +void skip_while_reverse(Iterator& it, const BeginIterator& begin, T condition) +{ + while (it != begin and condition(*it)) + --it; +} + using Utf8Iterator = utf8::iterator; inline Selection utf8_range(const Utf8Iterator& first, const Utf8Iterator& last) diff --git a/src/utils.hh b/src/utils.hh index 31fd0cdd..ee2591c0 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -78,20 +78,6 @@ private: template T* Singleton::ms_instance = nullptr; -template -void skip_while(Iterator& it, const EndIterator& end, T condition) -{ - while (it != end and condition(*it)) - ++it; -} - -template -void skip_while_reverse(Iterator& it, const BeginIterator& begin, T condition) -{ - while (it != begin and condition(*it)) - --it; -} - // *** On scope end *** // // on_scope_end provides a way to register some code to be