title: Creating an input stream from constant memory
body: <p>I have some data in a buffer pointed to by a <code>const char*</code> pointer. The data is just an ASCII string. I know its size. I would like to be able to read it in the same way data is read from streams. I'm looking for a solution that would allow me to write code like this:</p>
  
  <pre><code>// for example, data points to a string "42 3.14 blah"
  MemoryStreamWrapper in(data, data_size);
  int x;
  float y;
  std::string w;
  in &gt;&gt; x &gt;&gt; y &gt;&gt; w;
  </code></pre>
  
  <p>Important condition: <em>the data must not be copied or altered in any way</em> (otherwise I'd just use a string stream. To my best knowledge, it isn't possible to create a string stream from a const char pointer without copying the data.)</p>