I want to make a BigInteger object (for practice). I want the overloaded operators to accept any numerical datatype. I can do this polymorphically, but since it would be impractical to overload the 20+ binary operators for each of the 20~ numerical types, I would really like to do something like this:
X & operator+(const anynum input)
{
return this->value += input;
}
...
main()
{
X a = 1;
a = a + 1;
a = a + 1L;
}
sorry, my question is: "is this possible"?
I researched this most of last night I read through the operator overloading entry on cpp.com, the list of overloadable operators on wikipedia, various posts on stack overflow.