Skip to content

Commit 10c0b21

Browse files
authored
Update c5267.md
Hopefully clarify that although it is decpreated, it is still supported.
1 parent 9229c41 commit 10c0b21

File tree

1 file changed

+5
-1
lines changed
  • docs/error-messages/compiler-warnings

1 file changed

+5
-1
lines changed

docs/error-messages/compiler-warnings/c5267.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ helpviewer_keywords: ["C5267"]
1111
1212
## Remarks
1313

14-
Since C++11, when only the copy constructor or copy assignment operator is explicitly defined, implicitly generating the other is deprecated. However, to preserve backwards compatibility, the special functions are still implicitly generated.
14+
Since C++11, the C++ Standard deprecated (but did not removed) implicitly generating the copy constructor or copy assignment operator when only or the other is explicitly defined. The MSVC compiler continues to implicitly generate the copy constructor and copy assignment assignement operator when not explicitly defined. The purpose of this warning is to help users future proof their code if the committee decides to remove this functionality, instead of just deprecate it.
15+
16+
The relevant sections in the C++ standard are:
17+
- [class.copy.ctor paragraph 6](https://eel.is/c++draft/class.copy.ctor#6) which says: "If the class definition does not explicitly declare a copy constructor, a non-explicit one is declared implicitly. If the class definition declares a move constructor or move assignment operator, the implicitly declared copy constructor is defined as deleted; otherwise, it is defaulted. The latter case is deprecated if the class has a user-declared copy assignment operator or a user-declared destructor."
18+
- [Annex D D.8]([https://eel.is/c++draft/depr.impldec](https://eel.is/c++draft/depr.impldec#1)) which says: "The implicit definition of a copy constructor as defaulted is deprecated if the class has a user-declared copy assignment operator or a user-declared destructor. The implicit definition of a copy assignment operator as defaulted is deprecated if the class has a user-declared copy constructor or a user-declared destructor. It is possible that future versions of C++ will specify that these implicit definitions are deleted"
1519

1620
## Example
1721

0 commit comments

Comments
 (0)