C++ 23 · Containers and algorithms
Find the first match
Search with a predicate. The result is an iterator, end() if nothing matches.
auto it = std::find_if(v.begin(), v.end(), [](int n) { return n > 10; });
if (it != v.end()) std::cout << *it << '\n';