assignment operator return a reference to *this in C++
<p>I read about this from "Effective c++" ,this is Col.10.
It say it's a good way to have assignment operators return a reference to *this.
I wrote a code snippet to test this idea. I overridden the assignment operator here.And tested it. Everything is fine.
But when I remove that operator overriding, everything is the same. That means, the chaining assignment still works well. So, what am I missing? Why is that? Need some explanation from you guys, THank you.</p>

<pre><code>#include &lt;iostream&gt;

using namespace std;

class Widget{
public:

    Widget&amp; operator=(int rhs)
    {
        return *this;
    }
    int value;

};

int main()
{
    Widget mywidget;
    mywidget.value = 1;
    Widget mywidget2;
    mywidget2.value = 2;
    Widget mywidget3 ;
    mywidget3.value = 3;
    mywidget = mywidget2 = mywidget3;
    cout &lt;&lt; mywidget.value&lt;&lt;endl;
    cout &lt;&lt; mywidget2.value&lt;&lt;endl;
    cout &lt;&lt; mywidget3.value&lt;&lt;endl;

}
</code></pre>
