title: When does C++ perform deep copying and shallow copying?
body: <p>I wonder when C++ does deep copying, and when it does shallow copying.</p>
  
  <p>For example:</p>
  
  <pre><code>int find()
  {
      int n=5;
      return n;
  }
  </code></pre>
  
  <p>In order to delete n after moving out of the function, it must create a temporary variable n, and return it back to the caller. As a result, that's shallow copy, is that right?</p>