Is there any guarantee for the order in which C++ stack variables are destroyed
<p>Consider the following code:</p>

<pre><code>{
  std::auto_ptr&lt;Something&gt; p1(pSomePointer);
  std::auto_ptr&lt;Something&gt; p2(pSomeOtherPointer);
  ...
}
</code></pre>

<p>Is there any guarantee that p2 destructor will be called before p1's when exiting the scope? Common sense says that the stack variables should be destroyed from top of the stack first but C++ compiler can reorder assignments. </p>
