Why function does not work with delegate

Alex AJ at gmail.com
Thu May 23 10:14:32 UTC 2019


On Wednesday, 22 May 2019 at 23:54:47 UTC, Adam D. Ruppe wrote:
> 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) {};
>          ^^^^^^^^

That is what I was looking for.

Thanks.





More information about the Digitalmars-d-learn mailing list