From 01b66d9a7e537ac2e17fb4569ce03b02501534b2 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Thu, 11 Aug 2016 10:51:58 +0200 Subject: [PATCH] unique variable names in example --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 196a722..42ad27d 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -16181,7 +16181,7 @@ Note that a C-style `(T)expression` cast means to perform the first of the follo ##### Example, bad std::string s = "hello world"; - double* p = (double*)(&s); // BAD + double* p0 = (double*)(&s); // BAD class base { public: virtual ~base() = 0; }; @@ -16194,7 +16194,7 @@ Note that a C-style `(T)expression` cast means to perform the first of the follo }; derived1 d1; - base* p = &d1; // ok, implicit conversion to pointer to base is fine + base* p1 = &d1; // ok, implicit conversion to pointer to base is fine // BAD, tries to treat d1 as a derived2, which it is not derived2* p2 = (derived2*)(p);