[iter] Add operator ->

This commit is contained in:
Behdad Esfahbod 2018-12-26 18:58:42 -05:00
parent d3976b7e63
commit 2790aad28c
2 changed files with 3 additions and 1 deletions

View File

@ -28,6 +28,7 @@
#define HB_ITER_HH
#include "hb.hh"
#include "hb-dsalgs.hh" // for hb_addressof
#include "hb-null.hh"
@ -60,6 +61,7 @@ struct hb_iter_t
operator iter_t () { return iter(); }
explicit_operator bool () const { return more (); }
item_t& operator * () const { return item (); }
item_t* operator -> () const { return hb_addressof (item ()); }
item_t& operator [] (signed i) const { return item_at ((unsigned) i); }
iter_t& operator += (unsigned count) { forward (count); return *thiz(); }
iter_t& operator ++ () { next (); return *thiz(); }

View File

@ -631,7 +631,7 @@ template <typename T> struct hb_remove_pointer<T *> { typedef T value; };
#include "hb-mutex.hh"
#include "hb-null.hh"
#include "hb-dsalgs.hh" // Requires: hb-null
#include "hb-iter.hh" // Requires: hb-null
#include "hb-iter.hh" // Requires: hb-dsalgs hb-null
#include "hb-debug.hh" // Requires: hb-atomic hb-dsalgs
#include "hb-array.hh" // Requires: hb-dsalgs hb-iter hb-null
#include "hb-vector.hh" // Requires: hb-array hb-null