Skip to content

Commit 0522898

Browse files
committed
Add note about range operators being treated as postfix unary operators
1 parent 6828ff5 commit 0522898

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/cpp2/common.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ Postfix notation lets the code read fluidly left-to-right, in the same order in
222222

223223
> Note: The `...` pack expansion syntax is also supported.
224224
225+
> Note: The `(` `)`, `[` `]`, `..<`, and `..=` operators are treated as postfix unary operators, though they can take additional arguments.
226+
225227
> Note: Because `++` and `--` always have in-place update semantics, we never need to remember "use prefix `++`/`--` unless you need a copy of the old value." If you do need a copy of the old value, just take the copy before calling `++`/`--`. When you write a copyable type that overloads `operator++` or `operator--`, cppfront generates also the copy-old-value overload of that function to support natural use of the type from Cpp1 code.
226228
227229

0 commit comments

Comments
 (0)