title: Why below exception safety code using auto_ptr is different?
body: <p>Here's code which is not exception safe </p>
  
  <pre><code>//Header file declaration
  void f(auto_ptr&lt;T1&gt;, auto_ptr&lt;T2&gt;);
  
  //Implementation file:
  f(auto_ptr&lt;T1&gt;(new T1), auto_ptr&lt;T2&gt;(new T2));
  </code></pre>
  
  <p>Exception safe solution to above is suggested as :</p>
  
  <pre><code>//Implementation file:
  {
      auto_ptr&lt;T1&gt; t1(new T1);
      auto_ptr&lt;T2&gt; t2(new T2);
      f(t1, t2);
  }
  </code></pre>
  
  <p>My question is why it's different when both uses auto_ptr to handle resource allocation?</p>
  
  <p>This problem-solution is part of "More Exceptional C++" by Herb Sutter.</p>