bigint

Matthias Walter xammy at xammy.homelinux.net
Sun Nov 28 08:34:56 PST 2010


On 11/27/2010 02:05 PM, bearophile wrote:
>> Reduced case for bugzilla:
>>     
> http://d.puremagic.com/issues/show_bug.cgi?id=5281
>   
I investigated into the bug and the reason is the signature of opEquals,
which currently is

bool opEquals(Tdummy=void)(ref const BigInt y) const
bool opEquals(T: int)(T y) const

The only working sigature for array-of-structs-comparison to work is

bool opEquals(ref const BigInt y) const

But this removes the ability to compare against ints.
(btw, it should probably be long in the 2nd signature?!)

array-comparison should definitely take templated opEquals functions
into account, or is there something mentioned in the spec?

Matthias


More information about the Digitalmars-d-learn mailing list