From 05c44d23abd2ae9454bdeb3c134983eae4c905e6 Mon Sep 17 00:00:00 2001 From: Seulgi Kim Date: Sun, 8 Oct 2017 00:00:04 +0900 Subject: [PATCH] Fix typos in example. --- CppCoreGuidelines.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 2bd16cc..2688f1c 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -1021,7 +1021,7 @@ Time and space that you spend well to achieve a goal (e.g., speed of development x.ch = 'a'; x.s = string(n); // give x.s space for *p for (int i = 0; i < x.s.size(); ++i) x.s[i] = buf[i]; // copy buf into x.s - delete buf; + delete[] buf; return x; } @@ -16243,7 +16243,7 @@ and should be used only as building blocks for meaningful concepts, rather than template concept Addable = has_plus; // bad; insufficient - template auto algo(const N& a, const N& b) // use two numbers + template auto plus(const N& a, const N& b) // use two numbers { // ... return a + b; @@ -16273,7 +16273,7 @@ The ability to specify a meaningful semantics is a defining characteristic of a && has_multiply && has_divide; - template auto algo(const N& a, const N& b) // use two numbers + template auto plus(const N& a, const N& b) // use two numbers { // ... return a + b;