[map] Return const reference in operator[]
This commit is contained in:
parent
69d53f3e7f
commit
c72d3104ed
|
@ -211,7 +211,7 @@ struct hb_hashmap_t
|
||||||
void del (K key) { set_with_hash (key, hb_hash (key), item_t::default_value (), true); }
|
void del (K key) { set_with_hash (key, hb_hash (key), item_t::default_value (), true); }
|
||||||
|
|
||||||
/* Has interface. */
|
/* Has interface. */
|
||||||
typedef V value_t;
|
typedef const V& value_t;
|
||||||
value_t operator [] (K k) const { return get (k); }
|
value_t operator [] (K k) const { return get (k); }
|
||||||
bool has (K key, const V **vp = nullptr) const
|
bool has (K key, const V **vp = nullptr) const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue