Bitwise operations on integer act differently in DEBUG and RELEASE versions of project
<p>I use Visual Studio 2012 on Windows 8 64-bit.
I have these two methods:</p>

<pre><code>void Node::setState(States state, bool value) {
    if (value) {
        states_ |= 1 &lt;&lt; state;
    }
    else {
        states_ &amp;= ~(1 &lt;&lt; state);
    }
}

bool Node::getState(States state) {
    return (states_ &amp; (1 &lt;&lt; state)) != 0;
}
</code></pre>

<p>States enum:</p>

<pre><code>enum States {
    UPDATABLE = 0x01, // Node data update.
    RENDERABLE = 0x02, // Node rendering on screen.
    TRANSFORMABLE = 0x04, // Position, rotation and scaling update.
    POSITION = 0x08, // Position update.
    ROTATION = 0x10, // Rotation update.
    SCALING = 0x20 // Scaling update.
};
</code></pre>

<p>States integer initialization:</p>

<pre><code>states_(TRANSFORMABLE | RENDERABLE |
            UPDATABLE | POSITION | ROTATION | SCALING)
</code></pre>

<p>Now the problem is in this part of the code:</p>

<pre><code>LOGI("SETTING SCALING FOR NODE: %s", node-&gt;getName().c_str());
node-&gt;setState(Node::SCALING, true);
if (node-&gt;getState(Node::SCALING)) {
    LOGI("NODE WILL BE UPDATED.");
}
else {
    LOGI("NODE WILL NOT BE UPDATED.");
}
</code></pre>

<p>On Debug mode I get "NODE WILL BE UPDATED", on Release - "NODE WILL NOT BE UPDATED".
What is causing this?</p>
