[#BloombergLP-bslstl-HashTable-06-insert-08] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/HashTable-06.adoc[HashTable]::insert :relfileprefix: ../../../ :mrdocs: `insert` overloads == Synopses Declared in `<bslstl_hashtable.h>` Insert into this hash‐table a `ValueType` object created from the specified `value` and return the address of the newly inserted node. If a key equivalent to that of the newly‐created object already exists in this hash‐table, then insert the new object immediately before the first such element. Additional buckets are 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 the `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 is provided only to ensure backward compatibility with existing clients; use the `emplace` method instead. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class SOURCE_TYPE> xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]* xref:BloombergLP/bslstl/HashTable-06/insert-0e.adoc[insert](SOURCE_TYPE&& value); ---- [.small]#xref:BloombergLP/bslstl/HashTable-06/insert-0e.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class SOURCE_TYPE> xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]* xref:BloombergLP/bslstl/HashTable-06/insert-0c.adoc[insert]( SOURCE_TYPE&& value, xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]* hint); ---- [.small]#xref:BloombergLP/bslstl/HashTable-06/insert-0c.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#