Add a contains() method to silicondb::map
arindas opened this issue · 0 comments
arindas commented
Add a new method to silicondb::map
:
// map::contains(): returns true if the map contains a value mapped to the given key, false otherwise.
template <typename Key, typename Value, typename Hash = std::hash<Key>>
bool silicondb::map::contains(Key const& key) { ... }
The implementation will require adding a contains()
method for map::bucket
. We simply need to check whether, in the bucket mapped to the hash, there is an entry with the given key or not. (Hint: use find_entry_for
)