Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 8–4–4 (Required) function identifier with & or ()
#2
The rationale of the rule clearly explains that what has to be avoided is the possible mistake where
Code:
if ( f ) { ... }
is written where
Code:
if ( f() ) { ... }
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
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)