From 014c50292b471de0167b65fdc0eb446245438b84 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 9 Jan 2019 09:07:01 -0800 Subject: [PATCH] [iter] Move code --- src/hb-iter.hh | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/src/hb-iter.hh b/src/hb-iter.hh index db033fc82..60186d0cd 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -193,29 +193,13 @@ struct hb_is_iterator_of { enum { #define hb_is_sorted_iterator(Iter) \ hb_is_sorted_iterator_of (Iter, typename Iter::item_t) + /* - * Algorithms operating on iterators or iteratables. + * Adaptors, combiners, etc. */ -template -inline void -hb_fill (C& c, const V &v) -{ - for (typename C::iter_t i (c); i; i++) - hb_assign (*i, v); -} - -template -inline bool -hb_copy (D id, S is) -{ - for (; id && is; ++id, ++is) - *id = *is; - return !is; -} +/* hb_zip() */ template struct hb_zip_t : @@ -251,4 +235,29 @@ inline hb_zip_t hb_zip (A& a, B &b) { return hb_zip_t (a.iter (), b.iter ()); } + +/* + * Algorithms operating on iterators. + */ + +template +inline void +hb_fill (C& c, const V &v) +{ + for (typename C::iter_t i (c); i; i++) + hb_assign (*i, v); +} + +template +inline bool +hb_copy (D id, S is) +{ + for (; id && is; ++id, ++is) + *id = *is; + return !is; +} + + #endif /* HB_ITER_HH */