From 19d7fb14214eb92907c0c37df5e8c08ed9362b70 Mon Sep 17 00:00:00 2001 From: Andrew Pardoe Date: Mon, 23 Oct 2017 11:22:02 -0700 Subject: [PATCH] Update CppCoreGuidelines.md --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 187f929..e67da73 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -16251,11 +16251,11 @@ and should be used only as building blocks for meaningful concepts, rather than int x = 7; int y = 9; - auto z = plus(x, y); // z = 16 + auto z = algo(x, y); // z = 16 string xx = "7"; string yy = "9"; - auto zz = plus(xx, yy); // zz = "79" + auto zz = algo(xx, yy); // zz = "79" Maybe the concatenation was expected. More likely, it was an accident. Defining minus equivalently would give dramatically different sets of accepted types. This `Addable` violates the mathematical rule that addition is supposed to be commutative: `a+b == b+a`.