spec: Function types

Paul Backus snarwin at gmail.com
Sat Nov 21 00:42:06 UTC 2020


On Saturday, 21 November 2020 at 00:26:45 UTC, Dibyendu Majumdar 
wrote:
> So a type declared using 'function' is actually a function 
> pointer type.
>
> What is the type of a function in D?

int fun(int x);
pragma(msg, typeof(fun).stringof); // int(int x)
alias funType = int(int x);
static assert(is(funType == typeof(fun)));


More information about the Digitalmars-d mailing list