Pointers or copies?

Hasan Aljudy hasan.aljudy at gmail.com
Fri Dec 22 00:30:08 PST 2006



Tim Keating wrote:
> In article <emceee$2s0a$1 at digitaldaemon.com>, BCS at pathilink.com says...
>> Take a look at foreach. If queue is an array, this will work:
>>
>> foreach(item;queue) item.draw();
> 
> Little syntax nitpick -- that needs to be foreach(auto item; queue) 
> item.draw(), I believe.
> 
> Normally I wouldn't fuss, but the OP did say he was new to the language 
> :)
> 
> TK

Actually, no.

foreach( item; list ) { .. }

works automagically :)



More information about the Digitalmars-d mailing list