[#BloombergLP-bslalg-HashTableImpUtil-rehash]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/HashTableImpUtil.adoc[HashTableImpUtil]::rehash
:relfileprefix: ../../../
:mrdocs:

Populate the specified `newHashTable` with all the elements in the specified `elementList`, using the specified `hasher` to determine the (non&hyphen;adjusted) hash code for each element&period; This operation provides the strong exception guarantee unless the supplied `hasher` throws, in which case it provides no exception safety guarantee&period; The buckets in the array in `newAnchor` and the list root address in `newAnchor` are assumed to be garbage and overwritten&period; The behavior is undefined unless, `newHashTable` holds no elements and has one or more (empty) buckets, and `elementList` is a well&hyphen;formed bi&hyphen;directional list (see `BidirectionalLinkListUtil&colon;&colon;isWellFormed`) whose nodes are each of type `BidirectionalNode&lt;KEY&lowbar;CONFIG&colon;&colon;ValueType&gt;`, the previous address of the first node and the next address of the last node are 0&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;hashtableimputil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY&lowbar;CONFIG,
    class HASHER&gt;
static
void
rehash(
    xref:BloombergLP/bslalg/HashTableAnchor.adoc[HashTableAnchor]* newAnchor,
    xref:BloombergLP/bslalg/BidirectionalLink.adoc[BidirectionalLink]* elementList,
    HASHER const& hasher);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
