2024年6月14日发(作者:)

60 The right hand operand of a logical && or || operator shall not contain

side effects.

如下面的代码不是允许的:

[cpp] view plain copy

1. if ( ( a == 3 ) && b++ )

2. {

3. c = 1;

4. }

5. if ( ( a == 3 ) || b++ )

6. {

7. c = 1;

8. }

9. if ( ( a == 3 ) || func33 ( ) )

10. {

11. c = 1;

12. }

61 The operands of a logical && or || shall be primary-expressions.

用”()” 显示说明每一个优先级.

62 The operands of logical operators (&&, || and !) should be effectively

Boolean. Expressions that are effectively Boolean should not be used as operands

to operators other than (&&, || and !).

63 bitwise operators shall not be applied to exprands whose underlying type

is signed

64 The right hand operand of a shift operator shall lie between zero and one

less than the width in

bits of the underlying type of the left hand operand.

65 The unary minus operator shall not be applied to an expression whose

underlying type is unsigned.

66 The comma operator shall not be used.