Why doesn't GCC's ternary extension support assignment?
问题 GCC has an awesome ternary expression extension to C which allows us to create a statement like this: int x = some_var ?: 10; // expands to some_var ? some_var : 10 Which is really nice, and while it's not particularly intuitive, it does work. Most binary operators in the C language have an additional operator associated with them, which allows for assignment: x = x + 2; // instead, we can say x += 2; Since this is the case, and the norm for most binary C operators ( + , - , * , / , % , | , &