It's difficult to explain. I've created a Infinity Class, Infinity< t > , for example Infinity < int >, and it contains a bool that says if the infinity is + or - and operators overloading, so you can do all of this: infinity + int, int - infinity, infinity > int, infinity < infinity, -infinity, etc...
And that's great, it's exactly what I wanted, but the problem is that, to use it you have to declare a variable as Infinity, and I don't want that. I need to declare a integer, for example, and assign this Infinity to it, and then change its value when it's needed to a normal int. Example:
int data = +Infinity;
......
n = 3;
if (n < data) data = n;
So the question is, how can I assign this Infinity to any other kind of variable ( to a integer, double, float, etc), but still using the Infinity operators.
I mean, passing a Infinity object as a integer for example, and use its operators until I assign a normal int value to it. Is this possible? Thanks.