I have run a little microbenchmark and the results seem to be slightly in favor of range-based loops, though there is
some small variation across different tasks:
experiments/issue510/iterator-microbenchmark$ make -j2 && ./benchmark < .../scanalyzer-sat11-strips/p20.pddl/output
...
Running nothing 10000 times: 2.4e-05 seconds
Running standard loop over operators 10000 times: 5.52003 seconds
Running range-based loop over operators 10000 times: 5.51173 seconds
|