Shallow Copies
molecule water(3);
molecule water2 = water;
Now we have two molecules that share the same
atom_array -- this is almost definitely not what we
want, because changing molecule’s atom_array
will also change the other (destroying the whole
notion of object-oriented programming)
Previous slide
Next slide
Back to first slide
View graphic version