Iterators and Ranges: Comparing C++ to D to Rust

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Jun 14 13:52:31 UTC 2021


On Monday, 14 June 2021 at 13:45:14 UTC, Ola Fosheim Grøstad 
wrote:
> Also, his assumptions about performance were not really well 
> founded. You have to look at how iterators are used in actual 
> alogrithms and how that could block optimizations to say 
> anything sensible about that.

Think of it this way:

If it is possible write an O(1) wrapper around an iterator/range 
implementation and emulate any of the other interfaces, then they 
have the same performance (in terms of the ability to optimize).

I suspect that (except for table pointers) they are equivalent in 
O(1). So basically all the same...




More information about the Digitalmars-d mailing list