DMD 1.019 and 2.003 releases

Walter Bright newshound1 at digitalmars.com
Sun Jul 22 20:40:28 PDT 2007


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.



More information about the Digitalmars-d-announce mailing list