Behavior of "auto"

Sean Kelly sean at f4.ca
Fri Dec 7 05:31:32 PST 2007


bearophile wrote:
> Sean Kelly:
>> I'd guess that this is a bug, and is related to the extra work the 
>> compiler does for foreach loops.
> 
> This is a reduced and simplified version that shows the same thing:
> 
> class Foo {
>     ~this() {
>         printf("Destroyed\n");
>     }
> }
> 
> void main() {
>     foreach(i; new int[1])
>         scope Foo f = new Foo();
> }

Please submit a ticket for it if you haven't already :-)


Sean



More information about the Digitalmars-d mailing list