Convert delegate or function type to other.

John via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 18 13:15:30 PDT 2016


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);


More information about the Digitalmars-d-learn mailing list