On Thursday, 1 February 2018 at 11:51:11 UTC, aliak wrote:
Is there a way to do this:

import std.stdio;

void main()
{
    alias f = (a) => (b) => a * b;
    f(2)(3).writeln;
}

Error now is: Error: template lambda has no type

Cheers

This works:

void main()
{
        auto f = (size_t x) => (size_t y) => x * y;
        f(2)(3).writeln;
}

and this:

void main()
{
        alias f(T) = (T x) => (T y) => x * y;
        f!size_t(2)(3).writeln;
}

Reply via email to