好奇心から、これを尋ねる
下の式のように
a = (condition) ? x : y; // two outputs
列挙型の演算子を使用できないのはなぜですか?
いう、
myValue = f ??? fnApple() : fnMango() : fnOrange(); // no. of outputs specified in the enum definition
switch ステートメントの代わりに (リファクタリングは可能ですが)
enum Fruit
{
apple,
mango,
orange
};
Fruit f = Fruit.apple;
それとも、何の役にも立たない演算子ですか?