Re: [Boost-users] regex_token_iterator bug?
I can't reproduce that, can you provide test case?
Obviously my problem seems to be a little more subtile
than i thought. I wrapped my example to a (actually
three) stand alone program:
#include <iostream>
#include <iterator>
#include <string>
#include
#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.
On Thu, 3 Feb 2005 11:19:49 -0000, John Maddock
std::cout << i->length() << i++->str().length() <<
This is perfectly standard C++ I'm afraid, and is not a library or compiler bug.
... and why would you want to write your code that way anyhow? -- Caleb Epstein caleb dot epstein at gmail dot com
participants (3)
-
Caleb Epstein
-
Joe
-
John Maddock