title: Why doesn't std::queue::pop return value.?
body: <p>I went through this <a href="http://www.sgi.com/tech/stl/queue.html#3" rel="nofollow noreferrer">page</a> but I am not able to get the reason for the same . There it is mentioned that</p>
  <blockquote>
  <p>&quot;it is more sensible for it to return no value at all and to require
  clients to use front() to inspect the value at the front of the queue&quot;</p>
  </blockquote>
  <p>But inspecting an element from front() also required that element to be copied in lvalue. For example in this code segment</p>
  <pre><code>std::queue&lt;int&gt; myqueue;
  int myint;
  int result;
  std::cin &gt;&gt; myint;
  myqueue.push (myint);
  /* here temporary will be created on RHS which will be assigned to
     result, and in case if returns by reference then result will be
     rendered invalid after pop operation */
  result = myqueue.front();  //result.
  std::cout &lt;&lt; ' ' &lt;&lt; result;
  myqueue.pop();
  </code></pre>
  <p>on fifth line <em>cout</em> object first creates a copy of myqueue.front() then assigns that to result. So, whats the difference, pop function could have done the same thing.</p>