Skip to content

Commit 27f9403

Browse files
authored
Merge pull request #3508 from Bolpat/patch-13
Better wording for `ref` functions Signed-off-by: Nicholas Wilson <[email protected]> Merged-on-behalf-of: Nicholas Wilson <[email protected]>
2 parents 301db73 + 33a6e5f commit 27f9403

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

spec/function.dd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,11 @@ $(H2 $(LNAME2 nothrow-functions, Nothrow Functions))
598598

599599
$(H2 $(LNAME2 ref-functions, Ref Functions))
600600

601-
$(P Ref functions allow functions to return by reference,
602-
meaning that the return value must be an lvalue, and
603-
the lvalue is returned, not the rvalue.
601+
$(P A `ref` function returns by reference (instead of by value).
602+
The return value of a `ref` function must be an lvalue
603+
(whereas the return value of a non-`ref` function can be an rvalue, too).
604+
An expression formed by calling a `ref` function is an lvalue
605+
(whereas an expression formed by calling a non-`ref` function is an rvalue).
604606
)
605607

606608
---

0 commit comments

Comments
 (0)