Populate newAnchor by rehashing every node in elementList.

Synopsis

Declared in <bslalg_hashtableimputil.h>

template<
    class KEY_CONFIG,
    class HASHER>
static
void
rehash(
    HashTableAnchor* newAnchor,
    BidirectionalLink* elementList,
    HASHER const& hasher);

Description

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

Parameters

Name

Description

newAnchor

destination hash table to populate

elementList

well‐formed bidirectional list of nodes to rehash

hasher

hash functor used to compute each element's hash code

Created with MrDocs