Steven Schveighoffer wrote:
The other possibly sensible reason to keep opApply is for interfaces/classes. Ranges as a class would be slower than even opApply, as each loop iteration would call a virtual function.
There would only need to be one vtable lookup for each function (since every iteration would use the same head(), next(), etc.) So it would be the same price as opApply (a function pointer call). Well, 3 times the price, since 3 functions need to be called.
