[Issue 4340] New: Arithmetic impossible with const BigInt

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 17 02:12:04 PDT 2010


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

           Summary: Arithmetic impossible with const BigInt
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: pelle.mansson at gmail.com


--- Comment #0 from Pelle Månsson <pelle.mansson at gmail.com> 2010-06-17 02:12:02 PDT ---
This program:


import std.bigint;

void main() {
    const BigInt a = 1;
    const BigInt b = a + 1;
}


gives this:


test5.d(6): Error: template std.bigint.BigInt.opBinary(string op,T) if ((op ==
"+" || op == "*" || op == "-" || op == "/" || op == "%") && is(T : BigInt))
does not match any function template declaration
test5.d(6): Error: template std.bigint.BigInt.opBinary(string op,T) if ((op ==
"+" || op == "*" || op == "-" || op == "/" || op == "%") && is(T : BigInt))
cannot deduce template function from argument types !("+")(int)
test5.d(6): Error: template std.bigint.BigInt.__ctor(T : string) does not match
any function template declaration
test5.d(6): Error: template std.bigint.BigInt.__ctor(T : string) cannot deduce
template function from argument types !()(_error_)


This is due to the opBinary being non-const in std.bigint.

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