07-07-2016, 02:29 PM
The rationale of the rule clearly explains that what has to be avoided is the possible mistake where
is written where
was intended. The former fragment compiles because of an implicit conversion to pointer (decay) and boolean evaluation.
In order to achieve this effect, the rule is so strict that (if interpreted literally) would ban the idiomatic
[code]
std:cout
Code:
if ( f ) { ... }
Code:
if ( f() ) { ... }
In order to achieve this effect, the rule is so strict that (if interpreted literally) would ban the idiomatic
[code]
std:cout
<t></t>