Handling Dangling pointer/reference in case of operator overloading
<p>Is it safe to write our own copy constructor always during operator overloading ?</p>

<pre><code>Complex Complex::operator+(const Complex&amp;  other)
{
    Complex local ;
    local.result_real = real + other.real;
    local.result_imaginary = imag + other.imag;
    return local ;
}
</code></pre>

<p>Most of the times i have seen the above format , instead of returning it as reference .</p>

<p>Can we take thumb rule like 
        1- Always pass the function parameter by  reference  .
        2- Always return the object by reference .</p>

<p>Is there any special case in operator overloading where we have to return the object by value only ?</p>
