Assign any event kind to a single templatized function ?

Basile B. via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 5 07:05:18 PDT 2016


On Monday, 5 September 2016 at 14:00:04 UTC, ag0aep6g wrote:
> On 09/05/2016 03:44 PM, Basile B. wrote:
>> [...]
>
> You can pass the delegate type itself by alias. Then Parameters 
> carries over the ref. Not sure if that's well-defined or if it 
> just happens to work.
>
>
>     void handlef(F)(Parameters!F a){writeln(a);}
> ...
>     foo.event3 = &handler.handlef!(typeof(foo.event3));

Nice !


More information about the Digitalmars-d-learn mailing list