mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Enforcement rule for I.3: Avoid singletons
Proposal revised as agreed in #266.
This commit is contained in:
parent
8275f69ce3
commit
1dc02e15a7
|
@ -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.
|
||||
|
||||
### <a name="Ri-typed"></a> I.4: Make interfaces precisely and strongly typed
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user