c++ Performance Of And Operator With Example
<p>I was wondering if the &amp;&amp; operator works in a cascading manor. Compare the following implementations of a rectangle collision check.</p>

<pre><code>inline bool RectInRect(RECT one,RECT two){
    if(one.left &lt; two.right)
    if(one.right &gt; two.left)
    if(one.top &lt; two.bottom)
    if(one.bottom &gt; two.top)
    return true;
    return false;
}


inline bool RectInRect(RECT one,RECT two){
        return (one.left &lt; two.right &amp;&amp; one.right &gt; two.left &amp;&amp;
            one.top &lt; two.bottom &amp;&amp; one.bottom &gt; two.top);
}
</code></pre>

<p>Are these both the same or will the top one operate faster? </p>
