Convert delegate or function type to other.

Rufus Smith via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 18 23:30:06 PDT 2016


On Monday, 18 July 2016 at 20:15:30 UTC, John wrote:
> On Monday, 18 July 2016 at 18:49:22 UTC, Rufus Smith wrote:
>> Suppose I have the following: alias func = void function(int);
>>
>> Is there a way to convert it automatically to something the 
>> same type except of delegate: alias del = toDel(func) = void 
>> delegate(int);?
>
> import std.traits;
> alias del = ReturnType!func delegate(Parameters!func);


Thanks, I guess that allows me to change the parameters too!




More information about the Digitalmars-d-learn mailing list