[Issue 1451] overloading methods by mixin in static if doesn't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 6 06:26:02 PST 2012


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



--- Comment #4 from dawg at dawgfoto.de 2012-03-06 06:26:02 PST ---
>Comment #2: mixin templates introduce distinct overload sets in order to
prevent accidental function hijacking.
Makes sense.

Just for the record, I tried to unroll a TypeTuple into an overloadset,
which now works fine after merging the overloads.

mixin template _visit(Nodes...) if(Nodes.length)
{
    void visit(Nodes[0] n);
    static if (Nodes.length > 1)
    {
        mixin _visit!(Nodes[1 .. $]) vi;
        alias vi.visit visit;
    }
}

-- 
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