We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc383d6 commit 2f0c2e5Copy full SHA for 2f0c2e5
CppCoreGuidelines.md
@@ -4701,7 +4701,7 @@ Users will be surprised if copy/move construction and copy/move assignment do lo
4701
};
4702
shared_ptr<Impl> p;
4703
public:
4704
- Silly(const Silly& a) : p{a.p} { *p = *a.p; } // deep copy
+ Silly(const Silly& a) : p(make_shared<Impl>()) { *p = *a.p; } // deep copy
4705
Silly& operator=(const Silly& a) { p = a.p; } // shallow copy
4706
// ...
4707
0 commit comments