This isn't a full blown issue really, but it's probably a lack of
understanding on my part.
variant<
typeA,
typeB,
int,
double> v;
gives me conversion ambiguities. I can remove the int and it works
fine. In an attempt to kludge it, I changed the int to a
rational<int>. However, now, "v = 12" is converted to a double, not
to the rational.
First question, would be, how exactly is the variant choosing to use
the double instead of the rational? Does it have anything to do with
order? Would
Correction to the below:
It is not int and double causing the problems (I have about 6-7 types
in here), it is, in fact int and bool. The question still stands, but
with different types.
However, I guess it wouldn't be all that difficult to just use 1 and 0.
On 10/25/05, Aaron Griffin
This isn't a full blown issue really, but it's probably a lack of understanding on my part.
variant< typeA, typeB, int, double> v;
gives me conversion ambiguities. I can remove the int and it works fine. In an attempt to kludge it, I changed the int to a rational<int>. However, now, "v = 12" is converted to a double, not to the rational.
First question, would be, how exactly is the variant choosing to use the double instead of the rational? Does it have anything to do with order? Would
be different compared to ? Is there any way to "slay" this ambiguity. It's a rather moot point, but I'd like to know if it's an int or a double, seperately, not one single double which would require me to determine if it is a whole number or not.
Thanks in advance, Aaron
participants (1)
-
Aaron Griffin