title: Pass Ostream into Istream
body: <p>I have one function that outputs data into an ostream object, and a constructor that initializes a class from an istream object in the exact same format. i.e</p>
  <pre><code>std::ostream&amp; operator&lt;&lt;(std::ostream &amp;os, const Matrix &amp;m) {
      // Output to os
  }
  </code></pre>
  <p>and then</p>
  <pre><code>Matrix::Matrix(std::istream&amp; in) {
      // Read from in to construct the object
  }
  </code></pre>
  <p>so how do I push the output of the first function to the input of the second? I have tried a lot of things, mostly trial and error, but am completely lost (i.e not even sure what stream type to use). Thanks</p>