提交 8903040f 编写于 作者: B Behdad Esfahbod

Actually make it work

上级 025eaa3c
......@@ -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; }
......
......@@ -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;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册