Should the if((int val = getvalue()) == x) form work
<p>This form does not compile with my VS2008 compiler.  Should it be possible?</p>

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

int getvalue() { return 3; }

int main(int argc, char* argv[])
{
if((int val = getvalue()) == 3)
    cout &lt;&lt; "val=" &lt;&lt; val &lt;&lt; "\n";
return 0;
}
</code></pre>

<p>This form does work.
    ...</p>

<pre><code>int val;
if((val = getvalue()) == 3)

...
</code></pre>

<p>Why does it not work?</p>
