We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa6055c commit f6a3c07Copy full SHA for f6a3c07
src/std-traits/operators.md
@@ -44,6 +44,11 @@ Discussion points:
44
- You could implement `Add` for two different types, e.g.
45
`impl Add<(i32, i32)> for Point` would add a tuple to a `Point`.
46
47
+The `Not` trait (`!` operator) is notable because it does not "boolify" like the
48
+same operator in C-family languages; instead, for integer types it negates each
49
+bit of the number, which arithmetically is equivalent to subtracting it from -1:
50
+`!5 == -6`.
51
+
52
</details>
53
54
[1]: https://doc.rust-lang.org/std/ops/index.html
0 commit comments