What's your problem? You can surely pass an iterator to a function.