digitalmars.D.learn - std.bigint.BigInt and const modifier
- Ruslan Mullakhmetov (26/26) Feb 16 2014 BigInt is a struct == ValueType, suppose i can assign
- bearophile (5/6) Feb 16 2014 It was a const correctness bug, but it's already fixed in recent
- Ruslan Mullakhmetov (2/9) Feb 16 2014 i use v2.064.2. is it outdated ?
- bearophile (7/8) Feb 16 2014 It will be fixed in dmd 2.065. It's not yet out but you can use
BigInt is a struct == ValueType, suppose i can assign const(BigInt) to BigInt const(BigInt)/const(BigInt) do not compile. Is it a bug or design considerations? test.d ---- import std.stdio; import std.bigint; void foo(BigInt b) { std.stdio.writefln("foo(%s)", b); } void main() { const BigInt b = BigInt("445216415446"); auto b1 = b / b; foo(b); } ---- $ dmd test.d /tmp/test.d(14): Error: 'b' is not of arithmetic type, it is a const(BigInt) /tmp/test.d(14): Error: 'b' is not of arithmetic type, it is a const(BigInt) /tmp/test.d(16): Error: function test.foo (BigInt b) is not callable using argument types (const(BigInt))
Feb 16 2014
Ruslan Mullakhmetov:Is it a bug or design considerations?It was a const correctness bug, but it's already fixed in recent D compilers. Bye, bearophile
Feb 16 2014
On Sunday, 16 February 2014 at 20:36:32 UTC, bearophile wrote:Ruslan Mullakhmetov:Is it a bug or design considerations?It was a const correctness bug, but it's already fixed in recent D compilers. Bye, bearophilerecent D compilers.i use v2.064.2. is it outdated ?
Feb 16 2014
Ruslan Mullakhmetov:i use v2.064.2. is it outdated ?It will be fixed in dmd 2.065. It's not yet out but you can use it already if you want to be on the "bleeding edge", it's currently in beta3 and most regressions are fixed, so it's probably better than using dmd 2.064.2. Bye, bearophile
Feb 16 2014