[Issue 14657] can alias auto ref function but only after it's been called before

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 8 23:43:09 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14657

--- Comment #2 from Daniel Kozak <kozzi11 at gmail.com> ---
Ok maybe I am wrong:

template unaryFun()
{
    void unaryFun(ref int a) pure nothrow @safe @nogc {}
    void unaryFun(int a) pure nothrow @safe @nogc {}
}

void unaryFun2()(auto ref int a) pure nothrow @safe @nogc {}

void main()
{
    int x;
    alias unaryFun!() u;
    alias unaryFun2!() u2;
    u(41);
    u2(41);
}


this works ok for u, but not for u2.

--


More information about the Digitalmars-d-bugs mailing list