C++ / Why Iterators Got It All Wrong

jmh530 via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 6 04:38:33 PDT 2017


On Wednesday, 6 September 2017 at 06:57:25 UTC, Ola Fosheim 
Grøstad wrote:
>
> Well, «C++ iterators» are table pointer abstractions, so you 
> need a pair.
>
> An «iterator» would be a possibly heavy object that is used for 
> traversing a possibly complex and heterogenous data-structure 
> without exposing any notion of size or end a-priori (e.g. 
> before it arrives at the end, if there is an end).

mir-ndslices are like a generalization of D's slices. Instead of 
pointer and a length, they are an iterator and lengths/strides. 
So the size is exposed.


More information about the Digitalmars-d mailing list