[Issue 6312] template instance cannot use argument from enclosing template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 11 08:25:21 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6312



--- Comment #1 from Trass3r <mrmocool at gmx.de> 2011-11-11 08:24:41 PST ---
Ok, here's a real ugly workaround:

extern(C) void printf(const char*, ...);
void h() { printf("h()"); }

class Bla
{
    mixin wrap!h;
}

private enum dummy {foo}

mixin template wrap(alias f)
{
    void blub(alias h = dummy)()
    {
        static if (is (h == enum))
            alias f g;
        else
            alias h g;

        g();
    }
}

void main()
{
    Bla b = new Bla();
    b.blub();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list