Why is return value of queue:front() valid after queue::pop()
<p>I am new to C++ and ran into following <em>supposedly</em>  bug, but somehow my program just works..
Here is the code</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;queue&gt;
#include &lt;string&gt;


int main()
{
 string s ("cat");
 queue&lt;string&gt; _queue;
 _queue.push(s);
 string &amp; s1 = _queue.front();
 _queue.pop();
 // at this time s1 should become invalid as pop called destructor on s
 std::cout &lt;&lt; s1 &lt;&lt; std::endl;
 return 0;

 }
</code></pre>

<p>It just works, even though s1 is a reference to an invalid object. Is there a way i can assert that s1 truely refers to an invalid object?</p>
