[#BloombergLP-bdlcc-StripedUnorderedContainerImpl-setValueFirst-03]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/StripedUnorderedContainerImpl.adoc[StripedUnorderedContainerImpl]::setValueFirst
:relfileprefix: ../../../
:mrdocs:

Set the first element with `key` to `value`, inserting if absent&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
setValueFirst(
    KEY const& key,
    VALUE const& value);
----

== Description

Return the number of elements found with `key`&period; Note that if no elements were found, and a new value was inserted, `0` is returned&period; Also note that this method is more performant than `setValueAll` when there is one element having `key` in the hash map&period;

== Return Value

number of elements found with `key`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key of the element to set or insert
| *value*
| value to assign or insert
|===


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