Actually make it work

This commit is contained in:
Behdad Esfahbod 2019-05-07 00:13:11 -07:00
parent 025eaa3c81
commit 8903040fcd
2 changed files with 6 additions and 2 deletions

View File

@ -331,6 +331,7 @@ struct hb_map_iter_t :
void __forward__ (unsigned n) { it += n; }
void __prev__ () { --it; }
void __rewind__ (unsigned n) { it -= n; }
hb_map_iter_t __end__ () const { return hb_map_iter_t (it.end (), f); }
bool operator != (const hb_map_iter_t& o) const
{ return it != o.it || f != o.f; }
@ -376,6 +377,7 @@ struct hb_filter_iter_t :
bool __more__ () const { return bool (it); }
void __next__ () { do ++it; while (it && !hb_has (p.get (), hb_get (f.get (), *it))); }
void __prev__ () { --it; }
hb_filter_iter_t __end__ () const { return hb_filter_iter_t (it.end (), p, f); }
bool operator != (const hb_filter_iter_t& o) const
{ return it != o.it || p != o.p || f != o.f; }

View File

@ -145,17 +145,19 @@ struct hb_reference_wrapper
hb_reference_wrapper (const hb_reference_wrapper& o) : v (o.v) {}
bool operator == (const hb_reference_wrapper& o) const { return v == o.v; }
bool operator != (const hb_reference_wrapper& o) const { return v != o.v; }
operator T () const { return v; }
T get () const { return v; }
T v;
};
template <typename T>
struct hb_reference_wrapper<T&>
{
hb_reference_wrapper (T& v) : v (&v) {}
hb_reference_wrapper (T& v) : v (hb_addressof (v)) {}
hb_reference_wrapper (const hb_reference_wrapper& o) : v (o.v) {}
bool operator == (const hb_reference_wrapper& o) const { return v == o.v; }
bool operator != (const hb_reference_wrapper& o) const { return v != o.v; }
T* get () const { return v; }
operator T& () const { return *v; }
T& get () const { return *v; }
T* v;
};