3:42 PM
"Yes, I'm optimizing it for this case, because for the other cases, it will be almost as optimal than the current 2-iterator solution." That only makes sense if most of your uses of iteration will be that kind of thing. But reality is not like that at all. Most of the time, you are iterating over an actual range of actual values or manufacturing the range of values out of whole cloth. In both cases, iterator pairs have no overhead compared to a range.
And quite frankly, this problem can be fixed by allowing InputIterator to be single-access. That is, you can only do
*it
once between increments.Once you do that, the overhead either disappears entirely or becomes a single boolean value (to let you know whether the user accessed the iterator between increments, so that you don't have to read and discard data from your stream).
4:21 PM
If my iterator is is better at InputRange, and otherwise it has similar efficiency as the c++ iterators, then I consider it better.
« first day next day → last day (29 days later) »
Transcript for
Sep15
Sep '1716
Sep30
Discussion between Nicol Bolas and geza
Imported from a comment discussion on softwareengineering.stac...