Why function does not work with delegate

Adam D. Ruppe destructionator at gmail.com
Wed May 22 23:54:47 UTC 2019


On Wednesday, 22 May 2019 at 22:33:52 UTC, Alex wrote:
>     auto x = (GdkEventButton* e, Widget w) ...
>     X.addOnButtonPress(x);
>
> Why is x not a delegate?

Because you didn't ask for one and it didn't have to be.

Just add the delegate keyword to ask for one:

auto x = delegate(GdkEventButton* e, Widget w) {};
          ^^^^^^^^


More information about the Digitalmars-d-learn mailing list