From 2f5b1a9104e5f4a14aa77a2f4c3c6e1c2837500c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 27 Jan 2019 00:49:37 +0100 Subject: [PATCH] [iter] Add unary operator+ that returns a copy --- src/hb-iter.hh | 1 + src/test-iter.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 57a687af4..b98231070 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -69,6 +69,7 @@ struct hb_iter_t /* Operators. */ iter_t iter () const { return *thiz(); } + iter_t operator + () const { return *thiz(); } explicit_operator bool () const { return thiz()->__more__ (); } unsigned len () const { return thiz()->__len__ (); } hb_remove_reference (item_t)* operator -> () const { return hb_addressof (**thiz()); } diff --git a/src/test-iter.cc b/src/test-iter.cc index 97a739cd2..ef3543498 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -135,7 +135,7 @@ main (int argc, char **argv) hb_array_t > pa; pa->as_array (); - s + + s | hb_map (hb_identity) | hb_filter () | hb_filter (hb_bool)