Operator overloading, structs

Daniel Keep daniel.keep.lists at gmail.com
Tue Jun 2 00:36:44 PDT 2009



Don wrote:
> ...
> 
> On second thoughts, y = x.toLong or y = to!(long)(x) is probably better.
> Casts are evil, implicit casts even more so.

If you add a toLong or to_long member to BigInt, then to!(long)(x) will
work automatically.  Something similar applies to fromLong/from_long and
to!(BigInt)(cast(long)y).



More information about the Digitalmars-d mailing list