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


Matthias Walter <xa...@xammy.homelinux.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xa...@xammy.homelinux.net
         OS/Version|Windows                     |All


--- Comment #1 from Matthias Walter <xa...@xammy.homelinux.net> 2010-11-28 
08:27:14 PST ---
More precisely, the issue is that in the following code, the opEquals method is
not called for the array comparison. As it seems, the only opEquals signature
working for array comparison is "bool opEquals (ref const BigInt y) const",
making it impossible to have more versions to compare to different types.

struct BigInt
{
    bool opEquals (Tdummy = void)(ref const BigInt y) const
    {
      writefln("BigInt.opEquals!void(BigInt) called");
      return true;
    }

    bool opEquals (T: long) (long y) const
    {
      writefln("BigInt.opEquals!long called");
      return true;
    }
}

void main()
{
  BigInt i,j;

  writefln("i == j: %s", i == j);
  writefln("[i] == [j]: %s", [i] == [j]);
}

The output is:

BigInt.opEquals!void(BigInt) called
i == j: true
[i] == [j]: true

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

Reply via email to