From a3a218edb57e63f49b49ef847b258b641609a1d7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 18 Nov 2022 19:24:41 -0700 Subject: [PATCH] [map] Add a couple more sink interfaces --- src/hb-map.hh | 4 ++++ src/test-map.cc | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/hb-map.hh b/src/hb-map.hh index 5712eb03f..796b068ed 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -320,6 +320,10 @@ struct hb_hashmap_t { set (v.first, v.second); return *this; } hb_hashmap_t& operator << (const hb_pair_t& v) { set (v.first, std::move (v.second)); return *this; } + hb_hashmap_t& operator << (const hb_pair_t& v) + { set (std::move (v.first), v.second); return *this; } + hb_hashmap_t& operator << (const hb_pair_t& v) + { set (std::move (v.first), std::move (v.second)); return *this; } protected: diff --git a/src/test-map.cc b/src/test-map.cc index 8ccd71853..3e40513e0 100644 --- a/src/test-map.cc +++ b/src/test-map.cc @@ -199,6 +199,8 @@ main (int argc, char **argv) assert (v.length == 1); m1 << hb_pair_t {vector_t {4}, std::move (v)}; assert (v.length == 0); + m1 << hb_pair_t {vector_t {4}, vector_t {5}}; + m1 << hb_pair_t {vector_t {4}, vector_t {5}}; hb_hashmap_t m2; vector_t v2 {3};