title: Order of evaluation of assignment statement in C++
body: <pre><code>map&lt;int, int&gt; mp;
  printf("%d ", mp.size());
  mp[10]=mp.size();
  printf("%d\n", mp[10]);
  </code></pre>
  
  <p>This code yields an answer that is not very intuitive:</p>
  
  <blockquote>
    <p>0 1</p>
  </blockquote>
  
  <p>I understand why it happens - the left side of the assignment returns reference to <code>mp[10]</code>'s underlying value and at the same time creates aforementioned value, and only then is the right side evaluated, using the newly computed <code>size()</code> of the map.</p>
  
  <p>Is this behaviour stated anywhere in C++ standard? Or is the order of evaluation undefined?</p>
  
  <p>Result was obtained using g++ 5.2.1.</p>