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

Add `key`&sol;`data` if `key` is not already in the list&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
addUnique(
    KEY const& key,
    DATA const& data,
    bool* newFrontFlag = 0);
----

== Description

Insert `key`&sol;`data` if `key` is not already in the list&period;

Add the specified `key` &sol; `data` pair to this list&period; Load into the the optionally specified `newFrontFlag` a `true` value if the pair is at the front of the list, and a `false` value otherwise&period; Return 0 on success, and a non&hyphen;zero value (with no effect on the list) if `key` is already in the list&period;

== Return Value

0 on success, and a non&hyphen;zero value if `key` already exists

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key of the pair
| *data*
| data associated with `key`
| *newFrontFlag*
| if non&hyphen;null, set to whether the pair is at the front
|===


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