Changed iterators to use auto, many of which using range-based loops

std::find_if also can be used here.