diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 71a166740..2e767efd2 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -84,6 +84,10 @@ struct hb_iter_t iter_t operator ++ (int) { iter_t c (*thiz()); ++*thiz(); return c; } iter_t operator - (unsigned count) const { auto c = thiz()->iter (); c -= count; return c; } iter_t operator -- (int) { iter_t c (*thiz()); --*thiz(); return c; } + template + iter_t& operator >> (T &v) { v = **thiz(); ++*thiz(); return *thiz(); } + template + iter_t& operator << (const T v) { **thiz() = v; ++*thiz(); return *thiz(); } protected: hb_iter_t () {} diff --git a/src/test-iter.cc b/src/test-iter.cc index c36c5b975..2dbacae5b 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -149,5 +149,9 @@ main (int argc, char **argv) | hb_filter (hb_bool, hb_identity) ; + t << 1; + long vl; + s >> vl; + return 0; }