[#CuckooCache-cache-insert] = xref:CuckooCache.adoc[CuckooCache]::xref:CuckooCache/cache.adoc[cache]::insert :relfileprefix: ../../ :mrdocs: insert loops at most depth_limit times trying to insert a hash at various locations in the table via a variant of the Cuckoo Algorithm with eight hash locations. == Synopsis Declared in `<cuckoocache.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void insert(Element e); ---- == Description It drops the last tried element if it runs out of depth before encountering an open slot. Thus: ` insert(x); return contains(x, false); ` is not guaranteed to return true. == Parameters [cols="1,4"] |=== | Name| Description | *e* | the element to insert |=== == Postconditions * one of the following: All previously inserted elements and e are now in the table, one previously inserted element is evicted from the table, the entry attempted to be inserted is evicted. [.small]#Created with https://www.mrdocs.com[MrDocs]#