Thread overview
[Issue 4340] New: Arithmetic impossible with const BigInt
Jun 17, 2010
Pelle Månsson
Jun 17, 2010
Don
June 17, 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@puremagic.com
        ReportedBy: pelle.mansson@gmail.com


--- Comment #0 from Pelle Månsson <pelle.mansson@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: -------
June 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4340


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc


--- Comment #1 from bearophile_hugs@eml.cc 2010-06-17 02:36:59 PDT ---
Dupe of bug 4301 ?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4340


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug@yahoo.com.au
         Resolution|                            |DUPLICATE


--- Comment #2 from Don <clugdbug@yahoo.com.au> 2010-06-17 04:02:50 PDT ---
*** This issue has been marked as a duplicate of issue 4301 ***

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