[map] add a test for iteration

This commit is contained in:
rsheeter authored and Behdad Esfahbod committed 2019-05-08 15:08:33 -07:00
1 parent 183b8094b5
commit ba60512813
2 files changed
+5 -1

No files matched your search

+1 -1
View File
@@ -62,7 +62,7 @@ struct hb_hashmap_t
bool is_unused () const { return key == kINVALID; }
bool is_tombstone () const { return key != kINVALID && value == vINVALID; }
bool is_real () const { return key != kINVALID && value != vINVALID; }
hb_pair_t<K, V> get_pair() const { return hb_pair (key, value); }
hb_pair_t<K, V> get_pair() const { return hb_pair_t<K, V> (key, value); }
};
hb_object_header_t header;
+4
View File
@@ -206,6 +206,10 @@ main (int argc, char **argv)
| hb_reduce ([&] (int acc, int value) -> int { return acc; }, 2)
;
using map_pair_t = decltype (*hb_iter (m));
+ hb_iter (m)
| hb_map ([] (map_pair_t p) { return p.first * p.second; });
unsigned int temp1 = 10;
unsigned int temp2 = 0;
hb_map_t *result =