bigint

Kagamin spam at here.lot
Mon Nov 29 13:11:29 PST 2010


Don Wrote:

> > Why are they templated to begin with? Just for the heck of it?
> > 
> > bool opEquals(ref const BigInt y) const
> > bool opEquals(long y) const
> 
> No, because then it fails for ulong.
> It's those bloody C implicit conversions.

hmm... works for me:
---
struct A
{
	bool opEquals(ref const A y) const
	{
		return false;
	}
	bool opEquals(long y) const
	{
		return true;
	}
}

int main()
{
	A a;
	ulong b=42;
	assert(a==b);
	return 0;
}
---


More information about the Digitalmars-d-learn mailing list