|
|
|
@ -12889,7 +12889,7 @@ whereas `if (p != nullptr)` would be a long-winded workaround.
|
|
|
|
|
|
|
|
|
|
|
|
This rule is especially useful when a declaration is used as a condition
|
|
|
|
This rule is especially useful when a declaration is used as a condition
|
|
|
|
|
|
|
|
|
|
|
|
if (auto pc = dynamic_cast<Circle>(ps)) { ... } // execute is ps points to a kind of Circle, good
|
|
|
|
if (auto pc = dynamic_cast<Circle>(ps)) { ... } // execute if ps points to a kind of Circle, good
|
|
|
|
|
|
|
|
|
|
|
|
if (auto pc = dynamic_cast<Circle>(ps); pc != nullptr) { ... } // not recommended
|
|
|
|
if (auto pc = dynamic_cast<Circle>(ps); pc != nullptr) { ... } // not recommended
|
|
|
|
|
|
|
|
|
|
|
|
|