Right. Here are two ways I might do this.
The easiest way is to pass a pointer to the function, instead of an iterator.
Code:
void func(int *i) {
if(i == NULL) // invalid
}
std::vector<int>::iterator i = v.begin();
func(&(*i));
func(NULL);
Or you can pass a size_type, an index into the vector. (You know, like the way you address arrays.) You can turn an iterator into an index, if you want to, by using subtraction.
Code:
std::vector<int> v(10);
std::vector<int>::iterator i = v.begin();
i ++;
i ++;
std::cout << i - v.begin() << '\n';
And I think you can use (size_t)-1 or something like that to indicate an invalid index . . .