3 Feb
2005
3 Feb
'05
11:19 a.m.
#ifdef USE_1 std::cout << i->length() << i++->str().length() << std::endl; #endif
I believe that this is an issue with the evaluation of arguments: if you have a single expression the arguments are evaluated in an unspecified order - in this case the i++->str().length() gets evaluated before the i->length(), so i->length() is called on an end-of-sequence iterator (you should be able to confirm this by stepping through the code in your debugger). This is perfectly standard C++ I'm afraid, and is not a library or compiler bug. Hope this helps, John.