Skip to content

Commit b1ac924

Browse files
committed
Clarify function parameter description table
1 parent 0522898 commit b1ac924

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/cpp2/functions.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ calc: (number: _ is std::integral) = { /*...*/ }
4242
4343
There are six ways to pass parameters that cover all use cases, that can be written before the parameter name:
4444
45-
| Parameter ***kind*** | "Pass me an `x` I can ______" | Accepts arguments that are | Special semantics | ***kind*** `x: X` Compiles to Cpp1 as |
45+
| Parameter ***kind*** | "Pass an `x` the function ______" | Accepts arguments that are | Special semantics | ***kind*** `x: X` Compiles to Cpp1 as |
4646
|---|---|---|---|---|
47-
| `in` (default) | read from | anything | always `#!cpp const`<p>automatically passes by value if cheaply copyable | `X const x` or `X const& x` |
48-
| `copy` | take a copy of | anything | acts like a normal local variable initialized with the argument | `X x` |
49-
| `inout` | read from and write to | lvalues | | `X& x` |
50-
| `out` | write to (including construct) | lvalues (including uninitialized) | must `=` assign/construct before other uses | `cpp2::impl::out<X>` |
51-
| `move` | move from (consume the value of) | rvalues | automatically moves from every definite last use | `X&&` |
52-
| `forward` | forward | anything | automatically forwards from every definite last use | `T&&` constrained to type `X` |
47+
| `in` (default) | can read from | anything | always `#!cpp const`<p>automatically passes by value if cheaply copyable | `X const x` or `X const& x` |
48+
| `copy` | takes a copy of | anything | acts like a normal local variable initialized with the argument | `X x` |
49+
| `inout` | can read from and write to | lvalues | | `X& x` |
50+
| `out` | writes to (including construct) | lvalues (including uninitialized) | must `=` assign/construct before other uses | `cpp2::impl::out<X>` |
51+
| `move` | moves from (consume the value of) | rvalues | automatically moves from every definite last use | `X&&` |
52+
| `forward` | forwards | anything | automatically forwards from every definite last use | `T&&` constrained to type `X` |
5353
5454
> Note: All parameters and other objects in Cpp2 are `#!cpp const` by default, except for local variables. For details, see [Design note: `#!cpp const` objects by default](https://github.com/hsutter/cppfront/wiki/Design-note%3A-const-objects-by-default).
5555

0 commit comments

Comments
 (0)