diff --git a/src/test-iter.cc b/src/test-iter.cc index cd0a6bc07..173de966d 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -44,6 +44,21 @@ struct array_iter_t : hb_iter_t, T> hb_array_t arr; }; +template +struct some_array_t +{ + some_array_t (hb_array_t arr_) : arr (arr_) {} + + typedef array_iter_t iter_t; + array_iter_t iter () { return array_iter_t (arr); } + operator array_iter_t () { return iter (); } + operator hb_iter_t > () { return iter (); } + + private: + hb_array_t arr; +}; + + template inline void hb_fill (hb_iter_t i, const V &v) { @@ -71,10 +86,13 @@ main (int argc, char **argv) array_iter_t s2 (v); /* Implicit conversion from vector. */ array_iter_t t (dst); + some_array_t a (src); + s2 = s; hb_fill (t, 42); hb_copy (t, s); + hb_copy (t, a.iter ()); return 0; }