[#BloombergLP-bslalg-RbTreeUtil_Validator-isWellFormedAnchor] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/RbTreeUtil_Validator.adoc[RbTreeUtil_Validator]::isWellFormedAnchor :relfileprefix: ../../../ :mrdocs: Return `true` if the specified `tree` is well‐formed, without confirming that it refers to a valid‐red‐black tree, and `false` otherwise. This method will return `true` if _all_ of the following are true: == Synopsis Declared in `<bslalg_rbtreeutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static bool isWellFormedAnchor(xref:BloombergLP/bslalg/RbTreeAnchor.adoc[RbTreeAnchor] const& tree); ---- == Description 1. `tree.firstNode()` must refer to `tree.sentinel()` if `tree.rootNode()` is 0, and leftmost(tree.rootNode())' otherwise. 2. `tree.nodeCount()` must be the count of nodes in `tree` (not including the sentinel node). 3. `tree.sentinel()‐>leftchild()` is `tree.rootNode()`, and (if `tree.rootNode()` is not 0), `tree.rootNode()‐>parent()` is 'tree.sentinel(). 4. `tree.rootNode()` is 0 or `tree.rootNode().isBlack()` is `true` The behavior is undefined unless `tree.rootNode()` is 0, or refers to a valid binary tree. Note that this function provides a non‐templatized implementation for several criteria of a well‐formed tree (but not the complete set verified by `RbTreeUtil::isWellFormed`). [.small]#Created with https://www.mrdocs.com[MrDocs]#