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


Andrej Mitrovic <andrej.mitrov...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrov...@gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2012-01-21 
18:19:18 PST ---
Hows this for a workaround:

import std.traits;

class C
{
    void concatAssign(C other) { }
    void concatAssign(int other) { }

    auto ref opOpAssign(string s, T)(T t) if (s == "~")
    {
        static if (is(ReturnType!concatAssign == void))
            concatAssign(t);
        else
            return concatAssign(t);
    }
}

void main()
{
    auto c = new C;
    c.opOpAssign!"~"(c); // works
    c.opOpAssign!"~"(1); // works
    c ~= 1;              // works
}

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

Reply via email to