I have a vector containing objects, and each object has a method that returns a boolean.
I would like to find the first element whose method returns true.
I know I could simply iterate over the vector using a for loop, but I'm looking for a solution that uses the std library.
Googling I found nothing, just the find and find_if functions, but that's not what I'm looking for. I'm looking for a function that basically takes a reference to the vector and a lambda and returns the first element for which the lambda returns true.
Note: I would also be interested in a function that returns an element, and not necessarily the first.