Switch two values without temp storage
<p>I write this code to switch two values without temp storage and it works well, but when I try to use the same style to do other things, it doesn't work as I expected.</p>

<pre><code>                `     
 #include &lt;iostream&gt;
 using namespace std;

 int main(){
   int i=100,j=200;
   //expect swich i and j
   i=j+i-(j=i);
   cout&lt;&lt;i&lt;&lt;"   "&lt;&lt;j&lt;&lt;endl;

   //expect j=100 and i=300 
   i=j+(j=i);
   cout&lt;&lt;i&lt;&lt;"   "&lt;&lt;j&lt;&lt;endl;
 } 
</code></pre>

<p>result is:</p>

<pre><code>200    100
400    200
</code></pre>

<p>so why doesn't the second <code>(j=i)</code> work?</p>

<p><strong>can we just have a discussion about this situation? no one will maintain such code, including me.</strong></p>
