overloading operator puzzle: return *this, or temporary variable?
<p>if I overloading the + operator, I can use this(assume the class is className)</p>

<pre><code> className operator+(className &amp; c) { // version 1
    className T;
    ...
    return T;
}
</code></pre>

<p>also I can use</p>

<pre><code>className operator+(className &amp; c) {   // version 2
    ....
    return *this;
}
</code></pre>

<p>here's my question:</p>

<ol>
<li><p>in version 2, I return referfence or just like that? why?</p></li>
<li><p>version 1 and version 2, which one is better ? </p></li>
<li><p>we often write overloading =, &lt;&lt; return by reference, to use the chain =/&lt;&lt; , but why without reference we can't use chain =/&lt;&lt;, what's the copy thing really mean?</p></li>
<li><p>another question is that, I saw in effective c++: "use const whenever possible" and "prefer use pass by reference" , Is that mean that I write class function declaration use const and reference as much as possible?</p></li>
</ol>

<p>if I write like this:</p>

<pre><code>template&lt;typename T&gt; 
void Print(const T data[], const int &amp; arraySize)  // i use the const, and &amp;
{ 
   for(inti = 0; i &lt; arraySize; ++i) 
   cout &lt;&lt; data[i] &lt;&lt; " "; 
   cout &lt;&lt; endl; 
}
</code></pre>

<p>when I write in main() function,I write:</p>

<pre><code>int iArray[14] = {7,3,32,2,55,34,6,13,29,22,11,9,1,5}; 
int numInts = 14;    // do I need to specify numInts is const?? 
</code></pre>

<p>Print(iArray, numInts);    </p>
