[iter] Add operator << to set / vector
This commit is contained in:
parent
d438e61042
commit
a30e13469e
|
@ -373,6 +373,9 @@ struct hb_set_t
|
||||||
/* Predicate. */
|
/* Predicate. */
|
||||||
bool operator () (hb_codepoint_t k) const { return has (k); }
|
bool operator () (hb_codepoint_t k) const { return has (k); }
|
||||||
|
|
||||||
|
/* Sink interface. */
|
||||||
|
hb_set_t& operator << (hb_codepoint_t v) { add (v); return *this; }
|
||||||
|
|
||||||
bool intersects (hb_codepoint_t first, hb_codepoint_t last) const
|
bool intersects (hb_codepoint_t first, hb_codepoint_t last) const
|
||||||
{
|
{
|
||||||
hb_codepoint_t c = first - 1;
|
hb_codepoint_t c = first - 1;
|
||||||
|
|
|
@ -89,6 +89,9 @@ struct hb_vector_t
|
||||||
|
|
||||||
explicit_operator bool () const { return length; }
|
explicit_operator bool () const { return length; }
|
||||||
|
|
||||||
|
/* Sink interface. */
|
||||||
|
hb_vector_t& operator << (const Type &v) { push (v); return *this; }
|
||||||
|
|
||||||
hb_array_t< Type> as_array () { return hb_array (arrayZ(), length); }
|
hb_array_t< Type> as_array () { return hb_array (arrayZ(), length); }
|
||||||
hb_array_t<const Type> as_array () const { return hb_array (arrayZ(), length); }
|
hb_array_t<const Type> as_array () const { return hb_array (arrayZ(), length); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue