Operator overload
<pre><code>class test {
public:
    test &amp;operator=(const test &amp; other){} // 1
    const test &amp; operator+(const test&amp; other) const {} // 2
    const test &amp; operator+(int m) {} //3
private:
    int n;
};

int main()
{
test t1 , t2, t3;

// this works fine  t1 = t2.operator+(t3) , calls  2 and 1
t1 = t2 + t3; 

// this works fine    t1 = t2.operator+ (100). calls 3 and 1
t1 = t2 + 100;

//this works fine t1 = (t2.operator+ (100)).operator+ (t3)
t1 = t2 + 100 +t3;

//why is the error in this one  ????
// it should be t1 = (t2.operator+ (t3)).operator+ (100)
t1  =  t2 + t3 + 100; 

return 0;
}
</code></pre>
