gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [gnugo-devel] VC repair


From: Hellwig Geisse
Subject: RE: [gnugo-devel] VC repair
Date: Mon, 30 Dec 2002 10:20:22 +0100 (CET)

On 28-Dec-02 Arend Bayer wrote:
> 
> A few replies to follow...
> 
> Thanks everyone for fixing my VC breakage. Just out of curiosity, can
> someone tell whether this...
> 
> Nando wrote:
>> It seems the dumb VC++ doesn't understand these :
> [snip]
>> #define INITIAL_INFLUENCE(color) ((color) == WHITE ? \
>>                                                 initial_white_influence \
>>                                                :initial_black_influence)
>> 
>> &INITIAL_INFLUENCE(color)
>> &OPPOSITE_INFLUENCE(color)
>> 
> ...is a incorrect C or showing a VC bug?
> 
> Arend
> 

The operand of the '&' operator must be an lvalue. In ANSI C,
the ternary operator (e1 ? e2 :e3) does not yield an lvalue
but an rvalue (try '-pedantic' with gcc).

As far as I know, the situation changes with C++. To the best
of my knowledge (e1 ? e2 : e3) yields an lvalue, and thus the
construct &(e1 ? e2 : e3) is valid in C++.

Hellwig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]