[#BloombergLP-bdlcc-StripedUnorderedContainerImpl_Bucket-setValue-0b]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/StripedUnorderedContainerImpl_Bucket.adoc[StripedUnorderedContainerImpl&lowbar;Bucket]::setValue
:relfileprefix: ../../../
:mrdocs:

Set the value attribute of the element in this bucket having the specified `key` to the specified `value`, using the specified `equal` to compare keys&period; If no such element exists, insert `(key, value)`&period; The behavior with respect to duplicate key values in the bucket depends on the specified `scope`&colon;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class EQUAL&gt;
std::size&lowbar;t
setValue(
    KEY const& key,
    EQUAL const& equal,
    VALUE const& value,
    xref:BloombergLP/bdlcc/StripedUnorderedContainerImpl_Bucket/BucketScope.adoc[BucketScope] scope);
----

== Description

&colon; `e&lowbar;BUCKETSCOPE&lowbar;ALL`&colon;&colon; Set `value` to every element in the bucket having `key`&period;&colon;&colon; `e&lowbar;BUCKETSCOPE&lowbar;FIRST`&colon;&colon; Set `value` to the first element found having `key`&period;

Return the number of elements found having `key` that had their value set&period; Note that, when there are multiple elements having `key`, the selection of &quot;first&quot; is unspecified and subject to change&period; Also note that specifying `e&lowbar;BUCKETSCOPE&lowbar;FIRST` is more performant when there is a single element in the bucket having `key`&period;


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