closures

Jarrett Billingsley jarrett.billingsley at gmail.com
Thu Jul 16 11:57:12 PDT 2009


On Thu, Jul 16, 2009 at 2:33 PM, bearophile<bearophileHUGS at lycos.com> wrote:
> Jens:
>>  // On dmd v2.029, linux build, this...
>>   call(makedelegate1()); // ...works: 27
>>   call(makedelegate2()); // ...works: 7
>>   call(makedelegate3()); // ...doesn't work: 134518855
>>   call(makedelegate4()); // ...doesn't work: 134518947
>>   Foo f;
>>   call(&f.bar); // ...works: 7
>
> I have run your code with DMD v2.031 on Windows, and it prints:
> foo: 27
> foo: 7
> foo: 7
> foo: 7
> foo: 7

Strange.  I use 2.031 on Windows too, and I get strange values for the
third and fourth items, as expected.


More information about the Digitalmars-d-learn mailing list