BigInt -- a challenge for std.allocator

Froglegs barf at barf.com
Tue Oct 29 04:26:43 PDT 2013


>     BigInt n = 100;
>     n += 10;
>     ++n;
>
> ... and both the 2nd and 3rd lines will result in a 
> reallocation even though there is no need for it, because only 
> n is referencing the memory it wraps.


  Does BigInt not have overloaded operators for adding normal 
integers? Is it converting 10 to a BigInt prior to adding it to n?


More information about the Digitalmars-d mailing list