[#BloombergLP-bslalg-RbTreeUtil-insert] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/RbTreeUtil.adoc[RbTreeUtil]::insert :relfileprefix: ../../../ :mrdocs: Insert the specified `newNode` into the specified `tree`, organized according to the specified `comparator`. The resulting tree will be well‐formed (see `isWellFormed`). `NODE_COMPARATOR` shall be a functor providing a method that can be called as if it had the following signatures: ` bool operator()(const RbTreeNode&, const RbTreeNode&) const; ` The behavior is undefined unless `comparator` provides a strict weak ordering on objects of type `VALUE`, and `tree` is well‐formed (see `isWellFormed`). == Synopsis Declared in `<bslalg_rbtreeutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class NODE_COMPARATOR> static void insert( xref:BloombergLP/bslalg/RbTreeAnchor.adoc[RbTreeAnchor]* tree, NODE_COMPARATOR const& comparator, xref:BloombergLP/bslalg/RbTreeNode.adoc[RbTreeNode]* newNode); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#