the std::vector::iterator is not incrementable. In order to access an item you must use the [] operator.
i'm guessing that entities is a std::vector<base_entity*> pointers? Instead of passing the function a reference to a pointer, try just passing the pointer.