E
Enselic
I have problems finding out how to test weather an iterator are at the
end of its container.
I'd like to do something like the following:
std::list<int>::iterator it = intList.begin();
while (it != intList.end()) {
if (!it.has_next())
std::cout << "This is at the last item in the container\n";
std::cout << "Number: " << *it << std::endl;
it++;
}
How would I do this the Best way? Am I looking past something obvious
here?
end of its container.
I'd like to do something like the following:
std::list<int>::iterator it = intList.begin();
while (it != intList.end()) {
if (!it.has_next())
std::cout << "This is at the last item in the container\n";
std::cout << "Number: " << *it << std::endl;
it++;
}
How would I do this the Best way? Am I looking past something obvious
here?