title: Is there a C++ STL class that works like a pipe?
body: <p>In abstract terms a pipe is a stream/FIFO style container with a destructive read. It has a <code>read()</code> method that copies chunks of data all at once, and functions like <code>get</code> and <code>put</code> for single bytes. When the <code>read</code> or <code>get</code> returns though, the data that was copied out of the pipe is removed from the pipe's internal buffer - unlike a file or any other container type.</p>
  
  <p>Most (all?) of the STL containers do not provide a similar <code>read()</code> in to a buffer command. Is there a fifo container type with a <code>pop_many()</code> member?</p>
  
  <p><code>stringstream</code> is about the closest thing I can think of since it maintains an internal read pointer and future reads will block until the stream fills up again. The container is empty from the API point of view, but the consumed data would have to be garbage collected manually.</p>
  
  <p>Is there an equivalent container or stream class in C++ that does this, or is it a matter of roll-your-own (like in the stringstream example)?</p>