Copying and Assignment
Explore the concepts of copying and assignment in D classes. Understand how class variables reference objects, the role of dup() for creating copies, and how assignment impacts references and garbage collection in D.
We'll cover the following...
We'll cover the following...
Copying
Copying affects only the variables, not the object.
Because classes are reference types, defining a new class variable as a copy of another makes two variables that provide access to the same object. The actual object is not copied.
Since no object gets copied, the postblit ...