This should arguably be built into the iterators themselves; I think that this has come up before on the list, but I don't remember the outcome of the discussion.
The problem is that there is overhead from using `boost::optional` in all iterators. A better approach is to create fat ranges rather than fat iterators. So instead the function object is stored in the range, and the iterators reference the function from the range. Fat ranges also fixes the problem with dealing with temporary ranges as well. This is the approach that Eric Niebler uses for his ranges-v3, and the reason why he started writing the library: http://ericniebler.com/2013/11/07/input-iterators-vs-input-ranges/ Paul
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost