contains iterates through the hash locations for a given element and checks to see if it is present.
Declared in <cuckoocache.h>
bool
contains(
Element const& e,
bool const erase) const;
contains does not check garbage collected state (in other words, garbage is only collected when the space is needed), so:
` insert(x); if (contains(x, true)) return contains(x, false); else return true; `
executed on a single thread will always return true!
This is a great property for re-org performance for example.
contains returns a bool set true if the element was found.
true if the element is found, false otherwise
| Name | Description |
|---|---|
| e | the element to check |
| erase | whether to attempt setting the garbage collect flag |