
16 Jan
2010
16 Jan
'10
2:12 a.m.
Its implementation defined whether the evaluation of c==42 will happen before or after the evaluation of c++. I am happy to see a compiler that does emit a warning on this kind of code. Simply modify your code like this boost::format("%1% %2%") % (c==42) % c; c++; or this c++; boost::format("%1% %2%") % (c==42) % c; depending on what you actually intended.
More on the subject here: http://talesofcpp.blogspot.com/2009/10/episode-ten-natural-order-of-things.h...
Thanks for pointing this out. And sorry to spam the boost mailing list, for this unrelated question (as I know now). Henning