On Sun, 2006-09-03 at 20:08 +0000, lindevel at gmx dot net wrote: > > ------- Comment #4 from lindevel at gmx dot net 2006-09-03 20:08 ------- > You proved ##c++ wrong! They bet that I would be ignored. ;) > > The thing is that a void itself is not invalid. Using (expr ? void : void) > works as you see in my report. > In ##c++ I was told that ( x ? y : z ) wants both y and z to be of the same > type. And that is stated in no way by the error message.
void is valid if the both sides of the : are void, otherwise it is invalid. And they don't have to be the same type either, they can be different as long as one is convertible to the other (like float and int or two classes where one is a base class of the other). -- Pinski