opStar

David B. Held dheld at codelogicconsulting.com
Mon Nov 12 22:17:17 PST 2007


Sean Kelly wrote:
> 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.

int size[3] = { length, width, height };
std::sort(size + 0, size + 3);

I do lots of little stuff like this, which is very convenient.

Dave



More information about the Digitalmars-d mailing list