title: Append int to std::string
body: <p>I tried two different ways to append an <code>int</code> to a <code>std::string</code>, and to my surprise, I got different results:</p>
  
  <pre><code>#include &lt;string&gt;
  
  int main()
  {
      std::string s;
      s += 2;     // compiles correctly
      s = s + 2;  // compiler error
  
      return 0;
  }
  </code></pre>
  
  <p>Why does it compile and work correctly when I use the <code>+=</code> operator, but fail when I use the <code>+</code> operator?</p>
  
  <p>I don't think the question is like <a href="https://stackoverflow.com/questions/191757/how-to-concatenate-a-stdstring-and-an-int">How to concatenate a std::string and an int?</a></p>
  
  <p>In that question,no answer uses <code>+=</code> operator.And the difference between <code>+=</code>
  and <code>+</code> operator of <code>std::string</code> is the key to solve my doubt.</p>
  
  <p>Frankly,the question is a good example for explaining why c++ is so difficult to master.</p>