From d6ffbfdcc2c2f3ea051a92020bb918fcda93cc11 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Thu, 11 Aug 2016 18:44:49 +0200 Subject: [PATCH] missing semicolon --- CppCoreGuidelines.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 6f73058..0dadb30 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -12171,7 +12171,7 @@ Not all member functions can be called. ##### Example class vector { // very simplified vector of doubles - // if elem!=nullptr then elem points to sz doubles + // if elem != nullptr then elem points to sz doubles public: vector() : elem{nullptr}, sz{0}{} vctor(int s) : elem{new double},sz{s} { /* initialize elements */ } @@ -12182,7 +12182,7 @@ Not all member functions can be called. private: owner elem; int sz; - } + }; The class invariant - here stated as a comment - is established by the constructors. `new` throws if it cannot allocate the required memory. @@ -12360,7 +12360,7 @@ That would be a leak. void leak(int x) // don't: may leak { auto p = new int{7}; - if (x < 0) throw Get_me_out_of_here{} // may leak *p + if (x < 0) throw Get_me_out_of_here{}; // may leak *p // ... delete p; // we may never get here }