[Issue 11188] std.math.abs fails for shared, const or immutable BigInt types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 10 11:47:52 PDT 2013


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



--- Comment #4 from Joseph Rushton Wakeling <joseph.wakeling at webdrake.net> 2013-10-10 11:47:51 PDT ---
Tweaking std.math.abs to accept an inout input results in the following error
when I added a regular BigInt to the unittests:

    assert(abs(BigInt(-234567)) == 234567);

-------------------------------
std/math.d(311): Error: function std.bigint.BigInt.opCmp (ref const(BigInt) y)
const is not callable using argument types (int) inout
std/math.d(311): Error: mutable method std.bigint.BigInt.opUnary!"-".opUnary is
not callable using a inout object
std/math.d(341): Error: template instance std.math.abs!(BigInt) error
instantiating
-------------------------------

So I'd guess in turn std.bigint.BigInt.opCmp (and other BigInt methods) ought
to require (or at least have available) inout input.

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