W dniu 11.10.2011 05:19, Ben Stott pisze:

> my_button2->callback( [this] () { this->my_button1->label("xxx");} ); // I 
> haven't specified the return type here; it will default to void. You could 
> just as easily use "[this] () ->  void {...}"

This probably will not work, because
[this] () { this->my_button1->label("xxx");}
is not a function (it is an object with operator(), and probably with 
field to store "this" pointer).

As I remember, only lambdas with empty [] can be compiled to pure C 
function and GCC do this, but VS not.
So, currently, under VS lambdas will newer work with fltk.

Maybe it is good idea to use some signal/slot system in new fltk3 to 
allow using complex lambdas (and avoid cast to/from void*)?
http://stackoverflow.com/questions/359928/which-c-signals-slots-library-should-i-choose
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to