Deep copy (source code)

= Deep copy

A copy that duplicates the relevant reachable mutable structure instead of sharing all original references. A <Memento pattern> snapshot containing mutable arrays must preserve their saved contents against subsequent mutation, whether by a suitable <deep copy> or by an immutable persistent representation. The intended ownership graph and any permitted sharing must be specified; blindly copying one outer object is only a shallow copy.