(bool : v1 : v2) is fine

Yotam Medini yotam@avanticorp.com
Wed Oct 28 17:28:00 GMT 1998


>Is this a bug or not?
>
>------- Forwarded Message
>...
>It seems that the C++ compiler has some issues interpreting constructs
>like (x ? "Ok" : "Nay")

I think it is fine. Any 
  (x ? v1 : v2)
should be ok, if both of the following hold:
  +   x  could be promopted to int (zero or non-zero)
  +   v1 and v2  are of the same type

-- yotam



More information about the Gcc-bugs mailing list