Показать сообщение отдельно
Старый 09.06.2004, 15:11   #4  
Андре is offline
Андре
Moderator
Сотрудники компании GMCS
 
2,375 / 464 (20) +++++++
Регистрация: 03.12.2001
Цитата:
Насколько я помню даже в стандарте C++ не описано поведение компилятора в данном случае....
Нет. Здесь я уже поспешил. Все-таки определено :

Цитата:
5.14 Logical AND operator [expr.log.and]

1 logical-and-expression:
inclusive-or-expression
logical-and-expression && inclusive-or-expression
The && operator groups left-to-right. The operands are both implic-
itly converted to type bool (_conv_). The result is true if both
operands are true and false otherwise. Unlike &, && guarantees left-
to-right evaluation: the second operand is not evaluated if the first
operand is false.

2 The result is a bool. All side effects of the first expression except
for destruction of temporaries (_class.temporary_) happen before the
second expression is evaluated.