title: When is a shallow copy desirable (instead of a deep copy)?
body: <p>Can someone give an example of a situation where a shallow copy is needed?</p>
  
  <p>Note that in some situations, shallow copy and deep copy are the same. This can happen when the object has no ownership over any of its subvariables; that is, all subvariables are <a href="http://en.wikipedia.org/wiki/Object_composition#Aggregation" rel="noreferrer">aggregated</a>. I'd like to see examples where the an object is <a href="http://en.wikipedia.org/wiki/Object_composition" rel="noreferrer">composed</a> from variables which it owns, and it still is desirable to copy them shallowly.</p>
  
  <p><b>Remark</b>: I don't care in which language the examples are given. I'm asking this question from a C++/Java/C# point of view, although I think copying is a language agnostic concept.</p>