As a quick aside, C# does not have a copy constructor like C++. You could implement a C# constructor to act like a C++ copy constructor, you don't get one for free without putting in some effort.
I'm not into C++, but read it acts like a shallow copy, only a user defined constructor can do a deep copy. Hence the tip about MemberwiseClone.
You also have ICloneable Interface (System) where you're supposed to implement cloning beyond MemberwiseClone, but since the interface doesn't mandate the level of copy you probably should write a constructor that takes another instance as parameter and document its behaviour.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.