提交 2f5b1a91 编写于 作者: B Behdad Esfahbod

[iter] Add unary operator+ that returns a copy

上级 fbab07f9
...@@ -69,6 +69,7 @@ struct hb_iter_t ...@@ -69,6 +69,7 @@ struct hb_iter_t
/* Operators. */ /* Operators. */
iter_t iter () const { return *thiz(); } iter_t iter () const { return *thiz(); }
iter_t operator + () const { return *thiz(); }
explicit_operator bool () const { return thiz()->__more__ (); } explicit_operator bool () const { return thiz()->__more__ (); }
unsigned len () const { return thiz()->__len__ (); } unsigned len () const { return thiz()->__len__ (); }
hb_remove_reference (item_t)* operator -> () const { return hb_addressof (**thiz()); } hb_remove_reference (item_t)* operator -> () const { return hb_addressof (**thiz()); }
......
...@@ -135,7 +135,7 @@ main (int argc, char **argv) ...@@ -135,7 +135,7 @@ main (int argc, char **argv)
hb_array_t<hb_vector_t<int> > pa; hb_array_t<hb_vector_t<int> > pa;
pa->as_array (); pa->as_array ();
s + s
| hb_map (hb_identity) | hb_map (hb_identity)
| hb_filter () | hb_filter ()
| hb_filter (hb_bool) | hb_filter (hb_bool)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册