Can we get rid of opApply?

Robert Fraser fraserofthenight at gmail.com
Tue Jan 20 10:13:49 PST 2009


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.



More information about the Digitalmars-d mailing list