diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-03-29 20:03:09 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-03-29 20:03:09 +0100 |
| commit | adaf6ecc40d91389783e01bd3ac8bca8579f3d28 (patch) | |
| tree | 1c5161378a9af797ea87f3bf1aa2fbb5cd3bb3df /src | |
| parent | 56b5300b9d1a070757855f01fe148274f1904d14 (diff) | |
Move skip_while helpers to selectors.hh
Diffstat (limited to 'src')
| -rw-r--r-- | src/selectors.hh | 14 | ||||
| -rw-r--r-- | 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<typename Iterator, typename EndIterator, typename T> +void skip_while(Iterator& it, const EndIterator& end, T condition) +{ + while (it != end and condition(*it)) + ++it; +} + +template<typename Iterator, typename BeginIterator, typename T> +void skip_while_reverse(Iterator& it, const BeginIterator& begin, T condition) +{ + while (it != begin and condition(*it)) + --it; +} + using Utf8Iterator = utf8::iterator<BufferIterator, utf8::InvalidPolicy::Pass>; 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<typename T> T* Singleton<T>::ms_instance = nullptr; -template<typename Iterator, typename EndIterator, typename T> -void skip_while(Iterator& it, const EndIterator& end, T condition) -{ - while (it != end and condition(*it)) - ++it; -} - -template<typename Iterator, typename BeginIterator, typename T> -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 |
