diff --git a/src/hb-map.hh b/src/hb-map.hh index 6af018552..8ff7b2d7c 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -219,7 +219,8 @@ struct hb_hashmap_t /* Has interface. */ typedef const V& value_t; value_t operator [] (K k) const { return get (k); } - bool has (K key, const V **vp = nullptr) const + template + bool has (K key, VV **vp = nullptr) const { if (unlikely (!items)) return false; diff --git a/src/test-map.cc b/src/test-map.cc index 8cabf53bd..473e8f4f6 100644 --- a/src/test-map.cc +++ b/src/test-map.cc @@ -217,6 +217,10 @@ main (int argc, char **argv) hb_hashmap_t>> m; m.get (0); + const hb::unique_ptr> *v1; + m.has (0, &v1); + hb::unique_ptr> *v2; + m.has (0, &v2); } return 0;