-
Notifications
You must be signed in to change notification settings - Fork 13.4k
What is 6th unary operator? #20876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In general reference is somewhat out-of-date, so there might actually be any number of operators not mentioned in reference and introduced recently. |
TL;DR Probably the deprecated According to the compiler internals, we have 4 unary operators (in the AST): (Operator name : expression)
From the POV of the compiler, the feature gated You may think of |
(Oh and the reference is probably out of date in several places, we haven't put effort in updating it yet) |
In reference 7.2.11 Unary operator expressions
But in document there is only 5 ops; '-', '*', '!', 'box', '&'.
What is the 6th unary op?
By the way, in Rust '+' is not an unary op. So this expression is invalid; 'let a = +(1+2);'.
Considering the symmetry of "+" & '-', I think '+' may be an unary operator.
Of course, '+' unary op has no effect.
The text was updated successfully, but these errors were encountered: