Return the first element of a vector matching a predicate.
Declared in <util/vector.h>
template<
typename V,
typename L>
std::optional<V>
FindFirst(
std::vector<V> const& vec,
L const fnc);
The first matching element, or std::nullopt when none match.
| Name | Description |
|---|---|
| vec | The vector to search. |
| fnc | The predicate invoked on each element until it returns true. |