? operator without else-part
I use C# ? operator when I have if-statements that affects one row and it's all good. But lets say I have this code (using classic if-statements): if(someStatement) { someBool = true; //someBools value is unknown } else { //Do nothing } This can be achieved on a one-liner by doing: someBool = (someStatement) ? true : someBool; But why can't I do something like this: someBool = (someStatement) ? true : ; //or possibly someBool = (someStatement) ? true; Is this possible in some way? If it is, is there any benefits of using one method over the other? And if not, why shouldn't you be able to do it