
hmm...you are right...it was optimized away... sorry for the noise Peter Bartlett schrieb:
Rest easy Hansi, I think your test is invalid.
You write:
vector[TestData]: iterator:0.00167619 vector[TestData]: BOOST_FOREACH:9.40008
I too get this result I don't do anything with "res". If I add res to the lines that are printed to cout to stop the compiler doing so much dead code elimination I get the following results:
vector[TestData]: iterator:32.1508 vector[TestData]: BOOST_FOREACH:30.584
[I won't read too much into FOREACH being faster either... in my experience the difference between iterators and FOREACH is lost in the noise of things beyond your control in all but the most extreme cases.]
Pete
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost