diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 52f686628..fc64e9707 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -138,6 +138,27 @@ struct } HB_FUNCOBJ (hb_ref); +template +struct hb_reference_wrapper +{ + hb_reference_wrapper (T v) : v (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; } + T v; +}; +template +struct hb_reference_wrapper +{ + hb_reference_wrapper (T& v) : v (&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; } + T* v; +}; + template struct hb_enable_if {}; template struct hb_enable_if { typedef T type; };