[#BloombergLP-bdlcc-StripedUnorderedContainerImpl_Bucket-setValue-0b] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/StripedUnorderedContainerImpl_Bucket.adoc[StripedUnorderedContainerImpl_Bucket]::setValue :relfileprefix: ../../../ :mrdocs: Set or insert the value for `key` according to `scope`. == Synopsis Declared in `<bdlcc_stripedunorderedcontainerimpl.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class EQUAL> std::size_t setValue( KEY const& key, EQUAL const& equal, VALUE const& value, xref:BloombergLP/bdlcc/StripedUnorderedContainerImpl_Bucket/BucketScope.adoc[BucketScope] scope); ---- == Description 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. If no such element exists, insert `(key, value)`. The behavior with respect to duplicate key values in the bucket depends on the specified `scope`: : `e_BUCKETSCOPE_ALL`:: Set `value` to every element in the bucket having `key`.:: `e_BUCKETSCOPE_FIRST`:: Set `value` to the first element found having `key`. Return the number of elements found having `key` that had their value set. Note that, when there are multiple elements having `key`, the selection of "first" is unspecified and subject to change. Also note that specifying `e_BUCKETSCOPE_FIRST` is more performant when there is a single element in the bucket having `key`. == Return Value number of elements found having `key` that had their value set == Parameters [cols="1,4"] |=== | Name| Description | *key* | key of the element to set or insert | *equal* | equality comparator for keys | *value* | value to assign or insert | *scope* | whether to update the first or all matching elements |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#