提交 971020ec 编写于 作者: G Garret Rieger

Add sink support for hb_hashmap_t and a reverse call to hb_pair_t.

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