BloombergLP::bslstl::HashTable::insert

Insert into this hash-table a ValueType object created from the specified value (immediately preceding the specified hint if hint is not null and the key of the node pointed to by hint is equivalent to that of the newly-created object), and return the address of the newly inserted node. If hint is null or the key of the node pointed to by hint is not equivalent to that of the newly created object, and a key equivalent to that of the newly-created object already exists in this hash-table, then insert the newly-created object immediately before the first such element. Additional buckets will be allocated, as needed, to preserve the invariant loadFactor <= maxLoadFactor. If this function tries to allocate a number of buckets larger than can be represented by this hash-table's SizeType, a std::length_error exception is thrown. This method requires that ValueType defined in the (template parameter) type KEY_CONFIG be move-insertable into this hash-table (see {Requirements on KEY_CONFIG}) and the (template parameter) type SOURCE_TYPE be implicitly convertible to ValueType. Note that this method is deprecated and is provided only to ensure backward compatibility with existing clients; use the emplaceWithHint method instead.

Synopsis

Declared in <bslstl_hashtable.h>

template<class SOURCE_TYPE>
bslalg::BidirectionalLink*
insert(
    SOURCE_TYPE&& value,
    bslalg::BidirectionalLink* hint);