[#BloombergLP-bdlcc-StripedUnorderedMultiMap-setValueFirst-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/StripedUnorderedMultiMap.adoc[StripedUnorderedMultiMap]::setValueFirst
:relfileprefix: ../../../
:mrdocs:

Set the first matching element&apos;s value by move, or insert one&period;

== Synopsis

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

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

== Description

Set the value attribute of the _first_ element in this hash map (of possibly many) found to have the specified `key` to the specified move&hyphen;insertable `value`&period; If no such such element exists, insert `(key, value)`&period; Return the number of elements found with `key`&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 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*
| move&hyphen;insertable value to assign or insert
|===


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