[iter] Implement friend opeator + (int, iter)
This commit is contained in:
parent
6dc4a1c9b1
commit
743ff09368
|
@ -67,6 +67,7 @@ struct hb_iter_t
|
|||
iter_t& operator -= (unsigned count) { rewind (count); return *thiz(); }
|
||||
iter_t& operator -- () { prev (); return *thiz(); }
|
||||
iter_t operator + (unsigned count) const { iter_t c (*thiz()); c += count; return c; }
|
||||
friend iter_t operator + (unsigned count, const iter_t &it) { return it + count; }
|
||||
iter_t operator ++ (int) { iter_t c (*thiz()); ++*thiz(); return c; }
|
||||
iter_t operator - (unsigned count) const { iter_t c (*thiz()); c -= count; return c; }
|
||||
iter_t operator -- (int) { iter_t c (*thiz()); --*thiz(); return c; }
|
||||
|
|
|
@ -71,6 +71,7 @@ test_iterator (Iterator it)
|
|||
|
||||
it += it.len () + 10;
|
||||
it = it + 10;
|
||||
it = 10 + it;
|
||||
|
||||
assert (*it == it[0]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue