title: C++ std::cout and << operator, priority
body: <p>I have code like this:</p>
  
  <pre><code>std::cout &lt;&lt; " a: " &lt;&lt; classDate.getDays() &lt;&lt; " b: " &lt;&lt; classDate++ &lt;&lt; " c: " &lt;&lt; classDate.getDays();
  </code></pre>
  
  <p>I overloaded post-increment operator.</p>
  
  <p>in class m_days variable has value:</p>
  
  <ul>
  <li>before ++ operator - 4  </li>
  <li>after ++ oprator -5</li>
  </ul>
  
  <p>My question is, why the results from cout are in wrong order:</p>
  
  <p>a: 5 b: 5 c: 4</p>
  
  <p>I checked it in debuger, values in class are correct. When I wrote the code like this :</p>
  
  <pre><code>std::cout &lt;&lt; " a: " &lt;&lt; classDate.getDays();
  std::cout &lt;&lt; " b: " &lt;&lt; classDate++;
  std::cout &lt;&lt; " c: " &lt;&lt; classDate.getDays();
  </code></pre>
  
  <p>everything is correct (a: 4 b: 5 c: 5).</p>
  
  <p>Is that operator priority issue ?</p>
  
  <p>Kamil</p>