[#BloombergLP-bslalg-RbTreeUtil-validateRbTree-07] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/RbTreeUtil.adoc[RbTreeUtil]::validateRbTree :relfileprefix: ../../../ :mrdocs: Return black‐node depth, loading violation details if invalid. == Synopsis Declared in `<bslalg_rbtreeutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class NODE_COMPARATOR> static int validateRbTree( xref:BloombergLP/bslalg/RbTreeNode.adoc[RbTreeNode] const** errorNode, char const** errorDescription, xref:BloombergLP/bslalg/RbTreeNode.adoc[RbTreeNode] const* rootNode, NODE_COMPARATOR const& comparator); ---- == Description Return the number of black nodes on each path from the specified `rootNode` to a leaf, and load violation details into the specified `errorNode` and `errorDescription` if the tree is invalid. == Return Value black‐node depth, 0 if `rootNode` is 0, or a negative number if invalid == Parameters [cols="1,4"] |=== | Name| Description | *errorNode* | set to a node that violates a red‐black constraint | *errorDescription* | set to a description of the violation | *rootNode* | root of the tree to validate, or 0 | *comparator* | functor used to order nodes in the tree |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#