title: Copy std::stack into an std::vector
body: <p>Is the following code guaranteed by the standard to work(assuming st is not empty)?</p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;stack&gt;
  int main()
  {
     extern std::stack&lt;int, std::vector&lt;int&gt; &gt; st;
     int* end   = &amp;st.top() + 1;
     int* begin = end - st.size();
     std::vector&lt;int&gt; stack_contents(begin, end);
  }
  </code></pre>