December 08, 2011 [Issue 7080] New: Chained BigInt.opAssign | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=7080 Summary: Chained BigInt.opAssign Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: Phobos AssignedTo: nobody@puremagic.com ReportedBy: bearophile_hugs@eml.cc --- Comment #0 from bearophile_hugs@eml.cc 2011-12-08 04:27:56 PST --- For uniformity with normal integers I'd like this handy assignment to work: import std.bigint; void main() { BigInt x, y; x = y = 1; } But with dmd 2.057beta it gives: test.d(4): Error: template std.bigint.BigInt.opAssign(T : long) does not match any function template declaration test.d(4): Error: template std.bigint.BigInt.opAssign(T : long) cannot deduce template function from argument types !()(void) I think the problem is solved returning the input argument from both opAssign: /// T opAssign(T: long)(T x) { data = cast(ulong)((x < 0) ? -x : x); sign = (x < 0); return x; } /// T opAssign(T:BigInt)(T x) { data = x.data; sign = x.sign; return x; } See also bug 7079. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 17, 2012 [Issue 7080] Chained BigInt.opAssign | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=7080 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |clugdbug@yahoo.com.au Resolution| |DUPLICATE --- Comment #1 from Don <clugdbug@yahoo.com.au> 2012-07-16 23:39:10 PDT --- *** This issue has been marked as a duplicate of issue 8165 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation