4 ms·
for (double x : { -10, -0.4, 1.1, 0.3, 1.3 }) h(x); Shorter, better.
by jzwinck 8y ago
for (double x : { -10, -0.4, 1.1, 0.3, 1.3 })
h(x);
Shorter, better.
- wnissen 8y agoYeah, for_each is a great idea and if you don't have C++'s complicated reference / copy object model it works very well. But it's not as nice as an actual for loop.
- olq_plo 8y agoThanks for the feedback, I am going to update the example in the readme. The point was that boost::histogram plays nicely with the C++ stdlib algorithms, but that seems to be distracting.