[#FindFirst]
= FindFirst
:mrdocs:

Return the first element of a vector matching a predicate&period;

== Synopsis

Declared in `&lt;util&sol;vector&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename V,
    typename L&gt;
std::optional&lt;V&gt;
FindFirst(
    std::vector&lt;V&gt; const& vec,
    L const fnc);
----

== Return Value

The first matching element, or std&colon;&colon;nullopt when none match&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *vec*
| The vector to search&period;
| *fnc*
| The predicate invoked on each element until it returns true&period;
|===


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