Creating a copy of the object for multiple comparison is a good practice?
<p>Suppose multiple comparations are required at once:</p>

<pre><code>enum usermode
{
    active,
    standingby,
    inactive,
    dead,
    // many other modes....
};
class A
{
public:
    usermode mode;
};
</code></pre>

<p>function inherited pointer to class A (ptr points to A)</p>

<p>Method A:</p>

<pre><code>if( ptr-&gt;mode == active || ptr-&gt;mode == standingby || ptr-&gt;mode == inactive || ptr-&gt;mode == dead ...//etc )
{
    //do something
}
</code></pre>

<p>Method B:  </p>

<pre><code>usermode cmpmode = ptr-&gt;mode;
if( cmpmode == active || cmpmode == standingby || cmpmode == inactive || cmpmode == dead ...//etc )
{
    //do something
}
</code></pre>

<p>Is it a good practice to do so?</p>
