BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation

Return the unique-insert location for value, using hint.

Synopsis

Declared in <bslalg_rbtreeutil.h>

template<
    class NODE_VALUE_COMPARATOR,
    class VALUE>
static
RbTreeNode*
findUniqueInsertLocation(
    int* comparisonResult,
    RbTreeAnchor* tree,
    NODE_VALUE_COMPARATOR& comparator,
    VALUE const& value,
    RbTreeNode* hint);

Description

Return the address of the node holding the specified value in the specified tree, or the parent for value otherwise, using the specified hint to improve performance when it is the immediate successor.

Return Value

address of the matching node, or the parent for inserting value

Parameters

NameDescription
comparisonResultset to 0 on match, else left/right child sign
treetree in which to locate value or its insert parent
comparatorfunctor used to order nodes against value
valuevalue whose unique insert location is returned
hintpossible immediate successor of value in tree