Get the return type of the function
Meta via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Feb 3 11:21:06 PST 2016
On Wednesday, 3 February 2016 at 18:40:27 UTC, xtreak wrote:
> Thanks. I was trying to get the return type of lambdas. I was
> trying the following and got an error. I was using dpaste with
> dmd 2.070
>
> writeln(ReturnType!(a =(a *a)))
>
> Error: template instance f662.main.ReturnType!((a) => a * a)
> does not match template declaration ReturnType(func...) if
> (func.length == 1 && isCallable!func)
Ah, I see. I'd like to test something; can you please change `(a)
=> a * a` to
`(int a) => a * a` and post the results?
More information about the Digitalmars-d-learn
mailing list