May be function? Predicate creates every time in cycle. If you wonna use predicate - use STL algorithms with it,
And size_t as index