Does the C++ Standard say I should be able to compare two default-constructed STL iterators for equality? Are default-constructed iterators equality-comparable?
I w
I believe you should pass a range to the function.
void fun(std::list::iterator beg, std::list::iterator end) { while(beg != end) { // do what you want here. beg++; } }