title: Why can't I call on the operator when I return by value instead of by reference?
body: <p>This code would work IF I was returning by reference.  My question is why can't I return by value ?</p>
  
  <pre><code>/* Boss is a struct I defined, but is literally empty */
  
  ostream operator&lt;&lt;( ostream &amp; speak, Boss y ) {
  
    speak &lt;&lt; "We need more profit!" &lt;&lt; endl;
    return speak;
  
  }
  
  int main() {
  
    Boss b;
    cout &lt;&lt; b &lt;&lt; endl;
  
  }
  </code></pre>
  
  <p>My speculation was that maybe it is because you can't call on functions with temporary objects, but I've called on functions with temporary objects before. Is this something specific to operators ?</p>