From what I understand, the following program
#include <map>
int main()
{
std::map<int,int> foo;
std::map<int,int>::iterator start = foo.begin();
while (start++ != foo.end())
;
}
should terminate, but it instead loops indefinitely using libstdc++ 4.7.2. Is the behavior exhibited by this program correct, or is there a bug in the standard library? What are the operational properties of operator++(int) on iterators?