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