From 4f2a64b920bb7d6057fa8dae0ba7022bcb908381 Mon Sep 17 00:00:00 2001 From: Andrew Pardoe Date: Mon, 12 Dec 2016 11:27:40 -0800 Subject: [PATCH] Per our discussion, C.42 enforcement belongs to C.41 --- CppCoreGuidelines.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index c8abe87..0ce6e3f 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -4544,6 +4544,11 @@ Compilers do not read comments. If a valid object cannot conveniently be constructed by a constructor, [use a factory function](#Rc-factory). +##### Enforcement + +* (Simple) Every constructor should initialize every member variable (either explicitly, via a delegating ctor call or via default construction). +* (Unknown) If a constructor has an `Ensures` contract, try to see if it holds as a postcondition. + ##### Note If a constructor acquires a resource (to create a valid object), that resource should be [released by the destructor](#Rc-dtor-release). @@ -4634,9 +4639,6 @@ Another reason is been to delay initialization until an object is needed; the so ##### Enforcement -* (Simple) Every constructor should initialize every member variable (either explicitly, via a delegating ctor call or via default construction). -* (Unknown) If a constructor has an `Ensures` contract, try to see if it holds as a postcondition. - ### C.43: Ensure that a class has a default constructor ##### Reason