Iterators and Ranges: Comparing C++ to D to Rust
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Mon Jun 14 15:22:29 UTC 2021
On Monday, 14 June 2021 at 15:12:56 UTC, Steven Schveighoffer
wrote:
> I'm referring to the talk, where you can use one function
> (search) to compose any possible "range" from the result that
> makes sense, but also ones that don't make sense.
Ok, but some complicated algorithms are sometimes easier to
express if you allow the ones that don't make sense (but does not
happen).
> A C++ "safe" iterator that is essentially a range under the
> hood doesn't compose any better than D ranges.
I don't think "C++ iterators" with safety checks essentially are
ranges, they are essentially checked pointers.
How would you quickly search an annotated suffix array with D
ranges as cursors?
More information about the Digitalmars-d
mailing list