I thought it might be useful to add explicit cast operator to defer to the ToX() functions in the BigNum template. For example:

operator int()
{
return ToInt();
}

I imagine this isn't normally an issue, so I'll try to give a superficial example of it's utility.

It was useful for me in a templated function that could use the normal base types, for which I decided to throw in BigNum. I was trying to cast to an int and chop off the factional component for some intermediate calculation. Of course with a function explicitly coded for BigNum, it wouldn't be a problem.

Added by: ~Rocko Bonaparte, 2012 IX 13

On second thought: never do this--ever. The implicit casts to int are destroying me.