From 0902d5d137db9a6754b92f4984a90f8132490ce9 Mon Sep 17 00:00:00 2001 From: kpx1894 Date: Tue, 6 Oct 2015 09:39:00 +0100 Subject: [PATCH] fixes to code examples in C.61 Two argument comparison operator in both code examples for "C.61: A copy operation should copy" has a body of single argument member operator. This fix keeps comparison operator outside class, but corrects its body. --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 5d3f273..d000c1f 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -4403,7 +4403,7 @@ After a copy `x` and `y` can be independent objects (value semantics, the way no bool operator==(const X& a, const X& b) { - return sz == a.sz && equal(p, p + sz, a.p, a.p + sz); + return a.sz == b.sz && equal(a.p, a.p + a.sz, b.p, b.p + b.sz); } X::X(const X& a) @@ -4434,7 +4434,7 @@ After a copy `x` and `y` can be independent objects (value semantics, the way no bool operator==(const X2& a, const X2& b) { - return sz == a.sz && p == a.p; + return a.sz == b.sz && a.p == b.p; } X2 x;