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

Return `true` if the specified `anchor` is well&hyphen;formed for the specified `hasher`&period; Use the specified `allocator` for temporary memory, or the default allocator if none is specified&period; For a `HashTableAnchor` to be considered well&hyphen;formed for a particular key policy, `KEY&lowbar;CONFIG`, and hash functor, `hasher`, all of the following must be true&colon;

== 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
bool
isWellFormed(
    xref:BloombergLP/bslalg/HashTableAnchor.adoc[HashTableAnchor] const& anchor,
    HASHER const& hasher,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator = 0);
----

== Description

1&period; The `anchor&period;listRootAddress()` is the address of a well&hyphen;formed doubly linked list (see `bslalg&lowbar;bidirectionallinklistutil`)&period; 2&period; Links in the doubly linked list having the same adjusted hash value are contiguous, where the adjusted hash value is the value returned by `computeBucketIndex`, for `extractKey&lt;KEY&lowbar;CONFIG&gt;(link)` and `anchor&period;bucketArraySize()`&period; 3&period; Links in the doubly linked list having the same hash value are contiguous&period; 4&period; The first and last links in each bucket (in the bucket array, anchor&period;bucketArrayAddress()&apos;) refer to a the first and last element in the well&hyphen;formed doubly linked list of all nodes in the list having an adjusted hash value equal to that bucket&apos;s array index&period; If no values in the doubly linked list have an adjusted hash value equal to a bucket&apos;s index, then the addresses of the first and last links for that bucket are 0&period;


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