mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Per our discussion, C.42 enforcement belongs to C.41
This commit is contained in:
parent
882d88ebe5
commit
4f2a64b920
|
@ -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.
|
||||
|
||||
### <a name="Rc-default0"></a>C.43: Ensure that a class has a default constructor
|
||||
|
||||
##### Reason
|
||||
|
|
Loading…
Reference in New Issue
Block a user