April 03, 2006 posible delegate/inerfunktion bug | ||||
---|---|---|---|---|
| ||||
I was writing a callback system for my program when the following issue turned up. (gdc mac 0.17) ext is a bool i a superclass void classfunktion() { //crashes with access violation //auto exitfunk=delegate bool(){return ext=true;}; //does not change ext //bool exitfunk(){return ext=true;}; //used here widgets[$-1]=new Widget("exit button",p,window,input,&exitfunk); } when i declared it at class level it works bool exitfunk(){return ext=true;}; is this expected behavior with delegate and inner functions or is it a bug? |
April 04, 2006 Re: posible delegate/inerfunktion bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johan Granberg | In article <e0qq49$2j9$1@digitaldaemon.com>, Johan Granberg says... > widgets[$-1]=new Widget("exit button",p,window,input,&exitfunk); >is this expected behavior with delegate and inner functions or is it a bug? You are storing a reference to a local variable. |
Copyright © 1999-2021 by the D Language Foundation