title: Why do member functions that overload the + operator typically have 2 arguments when 1 produces the same result?
body: <p>I've noticed that when people overload the <code>+</code> operator they often use two arguments when I've been able to simply pass in 1 and get the same result. What is the reasoning behind why the version with 2 arguments is preferred, when doing it the way with 1 seems to yield the same result?</p>
  <p>Below are two segments from my code. (I am using the cctype library for the c string manipulation.)</p>
  <p>One-argument version:</p>
  <pre class="lang-cpp prettyprint-override"><code>myString operator + (const myString&amp; rhs){
    int length = strlen(str) + strlen(rhs.str);
    char* buff = new char[length +1];
  
    strcpy(buff,str);
    strcat(buff,rhs.str);
    buff[length] = '\0';
  
    myString temp(buff);
    delete[]buff;
    return temp;
  }
  </code></pre>
  <p>Two-argument version:</p>
  <pre class="lang-cpp prettyprint-override"><code>friend myString operator + (const myString&amp; lhs,const myString&amp; rhs){
    int length = strlen(lhs.str) + strlen(rhs.str);
    char* buff = new char[length + 1];
    
    strcpy(buff,lhs.str);
    strcat(buff,rhs.str);
    buff[length] = '\0';
    
    myString temp(buff);
    delete[] buff;
    
    return temp;
  }
  </code></pre>