C++: Is the .end() iterator always the same value?
Is the .end() iterator always the same value regardless of the size of an Standard Library container?
No. std::vector::end(), for example, points one past the last element. This location changes depending on the number of items in the container and the address of the allocated memory.
If I'm not mistaken you can only compare iterators that belong to the same container. You can't compare a.begin() == b.end(), if that's what you are asking (you can't use the end of one container to check for the end of any other container).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement