[map] Add a couple more sink interfaces
This commit is contained in:
parent
90226eab89
commit
a3a218edb5
|
@ -320,6 +320,10 @@ struct hb_hashmap_t
|
|||
{ set (v.first, v.second); return *this; }
|
||||
hb_hashmap_t& operator << (const hb_pair_t<K, V&&>& v)
|
||||
{ set (v.first, std::move (v.second)); return *this; }
|
||||
hb_hashmap_t& operator << (const hb_pair_t<K&&, V>& v)
|
||||
{ set (std::move (v.first), v.second); return *this; }
|
||||
hb_hashmap_t& operator << (const hb_pair_t<K&&, V&&>& v)
|
||||
{ set (std::move (v.first), std::move (v.second)); return *this; }
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -199,6 +199,8 @@ main (int argc, char **argv)
|
|||
assert (v.length == 1);
|
||||
m1 << hb_pair_t<vector_t, vector_t&&> {vector_t {4}, std::move (v)};
|
||||
assert (v.length == 0);
|
||||
m1 << hb_pair_t<vector_t&&, vector_t> {vector_t {4}, vector_t {5}};
|
||||
m1 << hb_pair_t<vector_t&&, vector_t&&> {vector_t {4}, vector_t {5}};
|
||||
|
||||
hb_hashmap_t<vector_t, vector_t> m2;
|
||||
vector_t v2 {3};
|
||||
|
|
Loading…
Reference in New Issue