opStar

BCS ao at pathlink.com
Tue Nov 13 13:41:56 PST 2007


Reply to Bruno,

> Walter Bright wrote:
> 
>> Michel Fortin wrote:
>> 
>>> I can't comment much on that since the details are so scarse, but I
>>> hope you don't use the same syntax as in C++ for iterators. I've
>>> never like much C++ pointer-like iterators, and I don't think
>>> working with iterators should feel like we're manipulating pointers.
>>> 
>> The thing is that loops are a very fundamental construct, and being
>> to implement them efficiently is of major importance. The pointer
>> idiom has the advantage there.
>> 
> How would the pointer idiom have any advantage in terms of
> performance?? (versus say, structs with hasNext() and next() member
> functions)
> 

I /think/ part of the though is that in template code you want to be able 
to use pointers and other things with the exact same syntax. You don't want 
to have to hide the pointers to get them to act like iteraters.





More information about the Digitalmars-d mailing list