title: C++ std::queue does not want to push()
body: <p>This is a simple class and simple test function:</p>
  
  <pre><code>#include &lt;queue&gt;
  #include &lt;string&gt;
  
  namespace {
      using namespace std;
  }
  
  class NameStream {
      queue&lt;string&gt; stream;
  
  public:
      string operator * () { return stream.front(); }
      NameStream &amp;operator ++(int) { stream.pop(); return *this; }
      NameStream &amp;operator ++() { stream.pop(); return *this; }
      NameStream &amp;operator &lt;&lt;(string name) { stream.push(name); }
  
      operator bool() { return !stream.empty(); }
  };
  
  inline void nameStreamTest() {
      NameStream &amp;stream = *new NameStream;
  
      stream &lt;&lt; "hi" &lt;&lt; "hey" &lt;&lt; "hoy";
  
      while (stream) {
          printf("%s\n", (*stream++).c_str());
      }
  }
  </code></pre>
  
  <p>It falls in </p>
  
  <pre><code>NameStream &amp;operator &lt;&lt;(string name) { stream.push(name); }
  </code></pre>
  
  <p>inside queue's push procedure, here is the stack beyond my code:</p>
  
  <pre><code>#0  0x000b5079 in std::deque&lt;std::string, std::allocator&lt;std::string&gt; &gt;::push_back at stl_deque.h:1055
  #1  0x000b50f2 in std::queue&lt;std::string, std::deque&lt;std::string, std::allocator&lt;std::string&gt; &gt; &gt;::push at stl_queue.h:204
  #2  0x000b511c in NameStream::operator&lt;&lt; at NameStream.h:24
  #3  0x000b520f in nameStreamTest at NameStream.h:32
  </code></pre>
  
  <p>My experience fails in this case. What am I doing wrong?</p>
  
  <p>P.S.:</p>
  
  <pre><code>NameStream &amp;stream = *new NameStream;
  </code></pre>
  
  <p>Is used to clear off location of</p>
  
  <pre><code>stream
  </code></pre>
  
  <p>object at address (offset?) 0x7d (!) which causes same exception.</p>