opStar
Sean Kelly
sean at f4.ca
Mon Nov 12 21:00:10 PST 2007
David B. Held wrote:
> Sean Kelly wrote:
>> [...]
>> Sure. But how much value is there in supporting pointers as
>> iterators? Even the C++ community has moved away from this idea,
>> although the syntax still supports it.
>
> Actually, I use array-iterators all the time in C++ and it works great.
> Lots of people I know do as well. And being that D is practically a
> vector language, it would be an Unpardonable Sin for it not to support
> array-iterators.
Well sure, but do those iterators have to be pointers, or can they be a
struct which contains a pointer? The size isn't any different, and
structs can provide a lot of added value in terms of optional range
checking and such. I don't know of a single STL implementation that
uses raw pointers for vector iterators any more, for example.
Sean
More information about the Digitalmars-d
mailing list