That's because return
and break
are statements, not expressions. As such, you cannot use it in another expression in any way. if
and the others are similarly also statements.
What you can do however is rewrite your expression (for return
) so that it's not nested in an expression - not that I recommend writing code like that:
return x++, 0;
You can't do that for break
because it doesn't accept an expression.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…