BloombergLP::bdlcc::SkipList::addUniqueR

Add a unique key/data pair, searching from the back.

Synopsis

Declared in <bdlcc_skiplist.h>

int
addUniqueR(
    KEY const& key,
    DATA const& data,
    bool* newFrontFlag = 0);

Description

Insert key/data searching from the back of the list.

Add the specified key / data pair to this list. Search for the correct position for key from the back of the list (in descending order by key value). Load into the optionally specified newFrontFlag a true value if the pair is at the front of the list, and a false value otherwise. Return 0 on success, and a non-zero value (with no effect on the list) if key is already in the list.

Return Value

0 on success, and a non-zero value if key already exists

Parameters

NameDescription
keykey of the pair
datadata associated with key
newFrontFlagif non-null, set to whether the pair is at the front