ENUM conversion warning

 
Hi, I don't want to say it's a bug but... Below code is giving me implicit conversion warning on compilation even though I don't think there is any conversion happening there... Please correct me if I'm wrong.
enum ENUM_STRATEGY_DIRECTION {DIRECTION_NONE = 0, DIRECTION_LONG = 1, DIRECTION_SHORT = 2};
ENUM_STRATEGY_DIRECTION closedDirection   = NULL;

ENUM_ORDER_TYPE type = closedDirection == DIRECTION_LONG ?    // <=== "implicit enum conversion" warning on compilation
                       ORDER_TYPE_BUY :
                       closedDirection == DIRECTION_SHORT ?
                       ORDER_TYPE_SELL : WRONG_VALUE;
 
salvatoreone I don't think there is any conversion happening there... Please correct me if I'm wrong.

WRONG_VALUE is an int, not an ENUM_ORDER_TYPE, so you do have a conversion. Try ENUM_ORDER_TYPE(WRONG_VALUE)

 
William Roeder #:

WRONG_VALUE is an int, not an ENUM_ORDER_TYPE, so you do have a conversion. Try ENUM_ORDER_TYPE(WRONG_VALUE)

Thank you, that was it...