diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 2c885d676..730f6824c 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -430,6 +430,17 @@ static const struct { return hb_sink_t (*s); } } hb_sink HB_UNUSED; +static const struct +{ + template + void + operator () (Iter it) const + { + for (; it; ++it) + (void) *it; + } +} hb_drain HB_UNUSED; /* * Algorithms operating on iterators. diff --git a/src/test-iter.cc b/src/test-iter.cc index a96616369..d7e9a00ea 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -149,7 +149,12 @@ main (int argc, char **argv) ; + hb_iter (src) - | hb_apply (&st); + | hb_apply (&st) + ; + + + hb_iter (src) + | hb_drain + ; t << 1; long vl;