I'm trying to compare 2 variables with my enum's type : <p>I created an Enum wearState and then gave wearState as a type for two variables. But when I try to put them in a if condition with '||' or '&amp;&amp;', it doesn't work.
It says : "error : bad operand types for binary operator '||' "</p>

<pre><code>enum wearState {
        WRIST_MOVE,
        WRIST_IMMOBILE,
        BELT_NECK_MOVE,
        BELT_NECK_IMMOBILE,
        OTHER_IMMOBILE_STATE;
    }


enum chargingState {
        YES,
        NO,
    }

wearState lastState;
wearState currentState;
chargingState lastStateCharging;
chargingState currentStateCharging;

if (((currentState = wearState.BELT_NECK_IMMOBILE) || (currentState = wearState.WRIST_IMMOBILE)) &amp;&amp; 
    (lastStateCharging = chargingState.NO)) {

              /* .... */
 }
</code></pre>
