[#BloombergLP-bslalg-BidirectionalLinkListUtil-isWellFormed] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/BidirectionalLinkListUtil.adoc[BidirectionalLinkListUtil]::isWellFormed :relfileprefix: ../../../ :mrdocs: Return true if the bidirectional list starting from the specified `head`, and ending with the specified `tail` is well formed. A bidirectional list is well formed if `tail == head` (0 values are allowed) or all of the following conditions are met (note that `head` is renamed to `h` and `tail` to `t` for brevity): == Synopsis Declared in `<bslalg_bidirectionallinklistutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static bool isWellFormed( xref:BloombergLP/bslalg/BidirectionalLink.adoc[BidirectionalLink]* head, xref:BloombergLP/bslalg/BidirectionalLink.adoc[BidirectionalLink]* tail); ---- == Description 1. `h` and `t` are valid addresses. 2. `h‐>nextLink()‐>previousLink() == h` is true. 3. `!h‐>previousLink() || h‐>previousLink()‐>nextLink() == h` is true. 4. `t‐>previousLink()‐>nextLink() == t` is true. 5. `!t‐>nextLink() || t‐>nextLink()‐>previousLink() == t` is true. 6. For each `link` in the list different than `h` and `t` both `link‐>nextLink()‐>previousLink() == link` and `link‐>previousLink()‐>nextLink() == link` are true. The behavior is undefined unless `tail` can be reached from `head` following the chain of `nextLink` attributes of all the nodes in the open range `[head, tail)]`. [.small]#Created with https://www.mrdocs.com[MrDocs]#