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

Insert or update using the move&hyphen;insertable `value` for `key`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
insertUnique(
    KEY const& key,
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;VALUE&gt;] value);
----

== Description

If `key` already exists in this hash map, the value attribute of that element is set to `value`&period; Return 1 if an element is inserted, and 0 if an existing element is updated&period; The `value` object is left in a valid but unspecified state&period; If `value` is allocator&hyphen;enabled and `allocator() !&equals; value&period;allocator()` this operation may cost as much as a copy&period; Note that the return value equals the number of elements inserted&period;

== Return Value

1 if an element is inserted, and 0 if an existing element is updated

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key of the element to insert or update
| *value*
| move&hyphen;insertable value to assign or insert
|===


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