mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
commit
ca57720e30
|
@ -12168,7 +12168,7 @@ If you define any of the copy constructor, copy assignment operator, or destruct
|
||||||
|
|
||||||
In many cases, holding properly encapsulated resources using RAII "owning" objects can eliminate the need to write these operations yourself. (See Item 13.)
|
In many cases, holding properly encapsulated resources using RAII "owning" objects can eliminate the need to write these operations yourself. (See Item 13.)
|
||||||
|
|
||||||
Prefer compiler-generated (including `=default`) special members; only these can be classified as "trivial," and at least one major standard library vendor heavily optimizes for classes having trivial special members. This is likely to become common practice.
|
Prefer compiler-generated (including `=default`) special members; only these can be classified as "trivial", and at least one major standard library vendor heavily optimizes for classes having trivial special members. This is likely to become common practice.
|
||||||
|
|
||||||
**Exceptions**: When any of the special functions are declared only to make them nonpublic or virtual, but without special semantics, it doesn't imply that the others are needed.
|
**Exceptions**: When any of the special functions are declared only to make them nonpublic or virtual, but without special semantics, it doesn't imply that the others are needed.
|
||||||
In rare cases, classes that have members of strange types (such as reference members) are an exception because they have peculiar copy semantics.
|
In rare cases, classes that have members of strange types (such as reference members) are an exception because they have peculiar copy semantics.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user