Add sink support for hb_hashmap_t and a reverse call to hb_pair_t.
This commit is contained in:
parent
98eec3dd5f
commit
971020eca7
|
@ -217,6 +217,11 @@ struct hb_pair_t
|
|||
hb_pair_t (T1 a, T2 b) : first (a), second (b) {}
|
||||
hb_pair_t (const pair_t& o) : first (o.first), second (o.second) {}
|
||||
|
||||
hb_pair_t<T1, T2> reverse () const
|
||||
{
|
||||
return hb_pair_t<T1, T2> (second, first);
|
||||
}
|
||||
|
||||
bool operator == (const pair_t& o) const { return first == o.first && second == o.second; }
|
||||
|
||||
T1 first;
|
||||
|
|
|
@ -231,6 +231,10 @@ struct hb_hashmap_t
|
|||
| hb_map (hb_ridentity)
|
||||
)
|
||||
|
||||
/* Sink interface. */
|
||||
hb_hashmap_t<K, V, kINVALID, vINVALID>& operator << (const hb_pair_t<K, V>& v)
|
||||
{ set (v.first, v.second); return *this; }
|
||||
|
||||
protected:
|
||||
|
||||
unsigned int bucket_for (K key) const
|
||||
|
|
Loading…
Reference in New Issue