foreach reference to struct variable

Prashant V dmd at prashantv.com
Thu Feb 7 21:21:01 PST 2008


Denton Cockburn Wrote:
> use ref while indexing:
> 
> foreach (ref s; structs)
>    // do something

Ah that works great! Thanks. Is there anything similar for variables. Eg can I go

int test = 5;
ref auto test2 = test;
test++;

and have the change reflected in test?



More information about the Digitalmars-d mailing list