Search:
Forum
General C++ Programming
How does a deep copy constructor work?
How does a deep copy constructor work?
Feb 2, 2020 at 9:06pm UTC
closed account (
Ey80oG1T
)
When using pointers and constructors, sometimes you may accidentally have some mishaps and only shallow copy.
So how do you deep copy a constructor?
Feb 2, 2020 at 9:40pm UTC
nuderobmonkey
(640)
That affects the so-called rule-of-three/five/zero:
https://en.cppreference.com/w/cpp/language/rule_of_three
A working example is showed here:
https://cpppatterns.com/patterns/rule-of-five.html
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs