Summary: bigint rvalue equality
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Vladimir Matveev <> 2011-05-11 
09:46:20 PDT ---

import std.bigint;

BigInt foo() {
    return BigInt(128);

void main() {
    BigInt bar = BigInt(128);
    assert(foo() == bar);
    assert(bar == foo());  // *** HERE

does not compile with the following error on the marked line:
test.d(10): Error: foo() is not an lvalue

It seems that is because of the ref parameter of the opEquals method in the
BigInt structure. Obviously it is not needed for the parameter to be a
reference in this case, though it could be thought as a possible performance
tweak (I don't know for certain about the correctnes of this though).

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to