cannot deduce template lambda from argument

aliak something at something.com
Wed Dec 6 10:43:18 UTC 2017


On Wednesday, 6 December 2017 at 08:10:26 UTC, Biotronic wrote:
> On Tuesday, 5 December 2017 at 23:01:43 UTC, aliak wrote:
>> immutable lambda(T) = (T n) => n * n;
>
> Generally, you'd want to write
>
>     alias lambda = n => n * n;
>
> instead. That said, I don't see any reason why your syntax 
> shouldn't work, and would argue it's a bug. Please file it in 
> Bugzilla.
>
> --
>   Biotronic

Ok thanks! Done: https://issues.dlang.org/show_bug.cgi?id=18037

Btw, in the case of your suggested approach, what if I want to 
constrain the parameter type?


More information about the Digitalmars-d-learn mailing list