[#BloombergLP-ball-CategoryManager_RadixTree-forEachPrefix-0f]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/CategoryManager_RadixTree.adoc[CategoryManager&lowbar;RadixTree]::forEachPrefix
:relfileprefix: ../../../
:mrdocs:

`forEachPrefix` overloads

== Synopses

Declared in `&lt;ball&lowbar;categorymanager&lowbar;radixtree&period;h&gt;`

Call the specified `functor` for each key&hyphen;value pair whose key starts with the specified `prefix`&period; The `functor` should be a callable object that accepts two parameters&colon; `const bsl&colon;&colon;string&lowbar;view&amp;` for the key and `t&lowbar;VALUE&amp;` for the value&period; Return the number of times the functor was called&period; The order of visitation is unspecified&period; Noteice that the functor is able to modify the value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;FUNCTOR&gt;
xref:BloombergLP/ball/CategoryManager_RadixTree/size_type.adoc[CategoryManager&lowbar;RadixTree&lt;t&lowbar;VALUE&gt;::size&lowbar;type]
xref:BloombergLP/ball/CategoryManager_RadixTree/forEachPrefix-01.adoc[forEachPrefix](
    std::string&lowbar;view const& prefix,
    t&lowbar;FUNCTOR const& functor);
----

[.small]#xref:BloombergLP/ball/CategoryManager_RadixTree/forEachPrefix-01.adoc[_» more&period;&period;&period;_]#

Call the specified `functor` for each key&hyphen;value pair whose key starts with the specified `prefix`&period; The `functor` should be a callable object that accepts two parameters&colon; `const bsl&colon;&colon;string&lowbar;view&amp;` for the key and `const t&lowbar;VALUE&amp;` for the value&period; Return the number of times the functor was called&period; The order of visitation is unspecified&period; See also the manipulator variation that allows the functor to modify the value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;FUNCTOR&gt;
xref:BloombergLP/ball/CategoryManager_RadixTree/size_type.adoc[CategoryManager&lowbar;RadixTree&lt;t&lowbar;VALUE&gt;::size&lowbar;type]
xref:BloombergLP/ball/CategoryManager_RadixTree/forEachPrefix-03.adoc[forEachPrefix](
    std::string&lowbar;view const& prefix,
    t&lowbar;FUNCTOR const& functor) const;
----

[.small]#xref:BloombergLP/ball/CategoryManager_RadixTree/forEachPrefix-03.adoc[_» more&period;&period;&period;_]#


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