[Issue 251] foreach does not allow updating inside with block

David Medlock noone at nowhere.com
Thu Jul 13 16:53:02 PDT 2006


d-bugmail at puremagic.com wrote:

> http://d.puremagic.com/issues/show_bug.cgi?id=251
> 
> 
> 
> 
> 
> ------- Comment #1 from shro8822 at uidaho.edu  2006-07-13 18:46 -------
> use inout
> 
>   with(foo)
>   {
>     foreach( int n, inout Bar bar; arr ) bar.a = 100;
>   }
> 
> haven't tested this but...
> 
> INVALID I think
> 
> 
Has this changed?

I know the opApply used to require inout arguments, and they were 
implied mutable on iteration.



More information about the Digitalmars-d-bugs mailing list