BloombergLP::bslalg::RbTreeUtil::find

Return the leftmost node holding value, or tree.sentinel().

Synopsis

Declared in <bslalg_rbtreeutil.h>

template<
    class NODE_VALUE_COMPARATOR,
    class VALUE>
static
RbTreeNode const*
find(
    RbTreeAnchor const& tree,
    NODE_VALUE_COMPARATOR& comparator,
    VALUE const& value);

Description

Return the address of the leftmost node holding the specified value in the specified tree (organized according to the specified comparator) if found, and return tree.sentinel()' otherwise. COMPARATOR shall be a functor providing two methods that can be called as if they had the following signatures: ` bool operator()(const RbTreeNode&, const VALUE&) const; bool operator()(const VALUE&, 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).

Return Value

address of the leftmost node holding value, or the sentinel

Parameters

NameDescription
treetree to search
comparatorfunctor used to order nodes against value
valuevalue to locate in tree