diff --git a/src/hb-iter.hh b/src/hb-iter.hh index c3f3ab958..876793680 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -113,4 +113,22 @@ struct hb_iter_t }; +/* Functions operating on iterators or iteratables. */ + +template inline void +hb_fill (const C& c, const V &v) +{ + for (typename C::iter_t i (c); i; i++) + hb_assign (*i, v); +} + +template inline bool +hb_copy (hb_iter_t &id, hb_iter_t &is) +{ + for (; id && is; ++id, ++is) + *id = *is; + return !is; +} + + #endif /* HB_ITER_HH */ diff --git a/src/test-iter.cc b/src/test-iter.cc index 8a98df4e5..4daa971d5 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -59,22 +59,6 @@ struct some_array_t hb_array_t arr; }; - -template inline void -hb_fill (const C& c, const V &v) -{ - for (typename C::iter_t i (c); i; i++) - hb_assign (*i, v); -} - -template inline bool -hb_copy (hb_iter_t &id, hb_iter_t &is) -{ - for (; id && is; ++id, ++is) - *id = *is; - return !is; -} - int main (int argc, char **argv) {