diff --git a/src/test-iter.cc b/src/test-iter.cc index 304481a2b..e12a135c6 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -44,16 +44,23 @@ struct array_iter_t : hb_iter_t, T> hb_array_t arr; }; -template static inline bool -copy (D &d, hb_iter_t &s) +template inline void +hb_fill (const C &c, const V &v) +{ + for (typename C::iter_t i = c.iter (); i; i++) + hb_assign (*i, v); +} + +template inline bool +hb_copy (const D &d, const S &s) { typename S::iter_t is = s.iter (); typename D::iter_t id = d.iter (); - for (; d && s; ++d, ++s) - *d = *s; + for (; id && is; ++id, ++is) + *id = *is; - return !d; + return !id; } int @@ -69,7 +76,8 @@ main (int argc, char **argv) s2 = s; - copy (t, s); + hb_fill (t, 42); + hb_copy (t, s); return 0; }