title: Overloading << operator for std::ostream
body: <pre><code>ostream&amp; operator &lt;&lt;(ostream&amp; osObject, const storageRentals&amp; rentals)
  {
      osObject &lt;&lt; rentals.summaryReport();
      return osObject;
  }
  </code></pre>
  
  <p><code>summaryReport()</code> is a void function, and it is giving me an error:</p>
  
  <blockquote>
    <p>no operator "&lt;&lt;" matches these operands</p>
  </blockquote>
  
  <p>but the error is not there if I change the <code>summaryReport</code> function to an <code>int</code>, but the problem I have with that is you have to return a value, and it is printing it out on the screen.</p>
  
  <pre><code>void storageRentals::summaryReport() const
  {
     for (int count = 0; count &lt; 8; count++)
        cout &lt;&lt; "Unit: " &lt;&lt; count + 1 &lt;&lt; "    " &lt;&lt; stoUnits[count] &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Is there any way to overload <code>cout &lt;&lt;</code> with a void function?</p>