From 1dc02e15a79dd73825ec086fe2718fa167661085 Mon Sep 17 00:00:00 2001 From: Eliyahu Ravuna Date: Mon, 2 Nov 2015 22:08:31 +0200 Subject: [PATCH] Enforcement rule for I.3: Avoid singletons Proposal revised as agreed in #266. --- CppCoreGuidelines.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 9f9a517..5994ae3 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -1042,6 +1042,7 @@ Very hard in general. * Look for classes with names that include `singleton`. * Look for classes for which only a single object is created (by counting objects or by examining constructors). +* If a class X has a public static function that contains a function-local static of the class' type X and returns a pointer or reference to it, ban that. ### I.4: Make interfaces precisely and strongly typed