From 0b22b82159fe72f3ef93eed3d13ec5531e4099cf Mon Sep 17 00:00:00 2001 From: Sergey Zubkov Date: Fri, 7 Oct 2022 00:53:03 -0400 Subject: [PATCH] Revert "C.65: more explicit about the badness of bad example" This reverts commit 7ad62600f1a110d64126a16199d47611ebd00044. --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index dab5044..512a227 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -6380,7 +6380,7 @@ There is no known general way of avoiding an `if (this == &a) return *this;` tes The ISO standard guarantees only a "valid but unspecified" state for the standard-library containers. Apparently this has not been a problem in about 10 years of experimental and production use. Please contact the editors if you find a counter example. The rule here is more caution and insists on complete safety. -##### Example, bad +##### Example Here is a way to move a pointer without a test (imagine it as code in the implementation a move assignment): @@ -6388,7 +6388,7 @@ Here is a way to move a pointer without a test (imagine it as code in the implem T* temp = other.ptr; other.ptr = nullptr; delete ptr; - ptr = temp; // in case of self-move, this->ptr is now invalid + ptr = temp; ##### Enforcement -- 2.11.4.GIT