diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index ff7f72b14..d1820a32e 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -13335,9 +13335,9 @@ whereas `if (p != nullptr)` would be a long-winded workaround. This rule is especially useful when a declaration is used as a condition - if (auto pc = dynamic_cast(ps)) { ... } // execute if ps points to a kind of Circle, good + if (auto pc = dynamic_cast(ps)) { ... } // execute if ps points to a kind of Circle, good - if (auto pc = dynamic_cast(ps); pc != nullptr) { ... } // not recommended + if (auto pc = dynamic_cast(ps); pc != nullptr) { ... } // not recommended ##### Example