Hi all,
Just out of curiosity, asking this
Like the expression one below
a = (condition) ? x : y; // two outputs
why can't we have an operator for enums?
say,
myValue = f ??? fnApple() : fnMango() : fnOrange(); // no. of outputs specified in the enum definition
instead of switch statements (even though refactoring is possible)
enum Fruit
{
apple,
mango,
orange
};
Fruit f = Fruit.apple;
Or is it some kind of useless operator?