DMD 1.019 and 2.003 releases

BCS ao at pathlink.com
Mon Jul 23 10:00:47 PDT 2007


Reply to Walter,

> Kirk McDonald wrote:
> 
>> In the spec for the new ForeachRangeStatement, it says:
>> 
>> "If Foreach is foreach, then the variable is set to LwrExpression,
>> then incremented at the end of each iteration."
>> 
>> What does "incremented" mean, exactly? If have a class or struct that
>> defines opAddAssign, would it call foo.opAddAssign(1) (as ++foo
>> does)? Similarly, would the foreach_reverse form call
>> foo.opSubAssign(1)?
>> 
> Right now, it doesn't work with structs/classes, but when it does,
> it'll be as you wrote.
> 

what will this do

foreach(float f; 1 .. toBigFor1ToIncrement)

loop forever?





More information about the Digitalmars-d-announce mailing list