[#BloombergLP-bdlcc-SkipList-0a-update]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/SkipList-0a.adoc[SkipList]::update
:relfileprefix: ../../../
:mrdocs:

Assign `newKey` to the pair at `reference`, moving it as needed&period;

== Synopsis

Declared in `&lt;bdlcc&lowbar;skiplist&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
update(
    xref:BloombergLP/bdlcc/SkipList-0a/Pair.adoc[Pair] const* reference,
    KEY const& newKey,
    bool* newFrontFlag = 0,
    bool allowDuplicates = true);
----

== Description

Load into the optionally specified `newFrontFlag` a `true` value if the new location of the pair is the front of the list&period; Return 0 on success, `e&lowbar;NOT&lowbar;FOUND` if the pair referred to by `reference` is no longer in the list, or `e&lowbar;DUPLICATE` if the optionally specified `allowDuplicates` is `false` and `newKey` already appears in the list&period;

== Return Value

0 on success, or a non&hyphen;zero status code on failure

== Parameters

[cols="1,4"]
|===
| Name| Description
| *reference*
| pair in this list
| *newKey*
| new key assigned to the pair
| *newFrontFlag*
| if non&hyphen;null, set to whether the pair is at the front
| *allowDuplicates*
| whether duplicate keys are allowed
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
