Assigning object to method call
<p>I have a class whose name is YourClass. And my problem is WHY compiler do NOT generate an error for following code?</p>

<pre><code>YourClass AMethod(){ return YourClass();}
AMethod() = YourClass();
</code></pre>

<p>[In this case IN MY OPINION AMethod just return a value (I mean it do not have a l-value).]</p>

<p>EDIT:
If I can do that above why I can not do following</p>

<pre><code>int AMethod(){ return a;}
AMethod() = 5;
</code></pre>
