title: How are we allowed to chain together the insertion operator and other operators in general in C++?
body: <p>I'm trying to understand the underlying process in C++ that allows us to form the following expression in C++:</p>
  
  <pre><code>cout &lt;&lt; "Hello," &lt;&lt; "World" &lt;&lt; a + b;
  </code></pre>
  
  <p>From my understanding, first, the insertion operator takes the ostream object <code>cout</code> and the string literal <code>"Hello"</code> as operands and the expression returns a type of <code>cout</code> and thus <code>cout</code> is now the type of the next string literal and finally also the type of the expression <code>a + b</code>.</p>
  
  <p>I'm having trouble understanding the technical details of this process, I understand references are involved which allow us to do this ? </p>