[#BloombergLP-bdlcc-StripedUnorderedMap-visitReadOnly-0e] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/StripedUnorderedMap.adoc[StripedUnorderedMap]::visitReadOnly :relfileprefix: ../../../ :mrdocs: Call read‐only `visitor` on the element having `key`, if present. == Synopsis Declared in `<bdlcc_stripedunorderedmap.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int visitReadOnly( KEY const& key, xref:BloombergLP/bdlcc/StripedUnorderedMap/ReadOnlyVisitorFunction.adoc[ReadOnlyVisitorFunction] const& visitor) const; ---- == Description That is, for `(key, value)`, invoke: ` bool visitor(value, key); ` Return the number of elements visited or `‐1` if `visitor` returned `false`. `visitor` has read‐only access to each element for duration of each invocation. The behavior is undefined if hash map manipulators are invoked from within `visitor`, as it may lead to a deadlock. == Return Value the number of elements visited, or `‐1` if `visitor` returned `false` == Parameters [cols="1,4"] |=== | Name| Description | *key* | key of the element to visit | *visitor* | read‐only functor invoked with the matching element |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#