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

`findLongestCommonPrefix` overloads

== Synopses

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

Return the longest prefix of the specified `key` that has an associated value in this tree, or an empty string view if no such prefix exists&period; If the optionally specified `value` is not null, load into `&ast;value` a reference to the value associated with the returned prefix&period; Note that an empty return value can mean either that no matching prefix exists, or that the empty string itself is the longest matching prefix (when the tree contains a value for the empty key)&period; Also note that the returned reference (if set) remains valid until the tree is modified&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::string&lowbar;view
xref:BloombergLP/ball/CategoryManager_RadixTree/findLongestCommonPrefix-09.adoc[findLongestCommonPrefix](
    xref:BloombergLP/ball/CategoryManager_RadixTree/OptValueCRef.adoc[OptValueCRef]* value,
    std::string&lowbar;view const& key) const;
----

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

Return the longest matching key prefix with an associated value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::string&lowbar;view
xref:BloombergLP/ball/CategoryManager_RadixTree/findLongestCommonPrefix-03.adoc[findLongestCommonPrefix](
    xref:BloombergLP/ball/CategoryManager_RadixTree/OptValueRef.adoc[OptValueRef]* value,
    std::string&lowbar;view const& key);
----

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


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