BloombergLP::bdlc::FlatHashTable::insert

Insert the specified entry if its key is not already present.

Synopsis

Declared in <bdlc_flathashtable.h>

bsl::pair<FlatHashTable<KEY, ENTRY, ENTRY_UTIL, HASH, EQUAL>::iterator, bool>
insert(ENTRY const& entry);

Description

Insert the specified entry into this table if the key of the entry does not already exist in this table; otherwise, this method has no effect. Return a pair whose first member is an iterator referring to the (possibly newly inserted) object in this table whose key is the equal to that of the object to be inserted, and whose second member is true if a new entry was inserted, and false if a entry having an equal key was already present. Bitwise movable types that are not bitwise copyable will be copied (to avoid confusion with regard to calling the entry destructor after this call).

Return Value

pair of iterator to the entry and whether insertion occurred

Parameters

NameDescription
entryentry to insert if its key is absent