Skip to content

Commit 58d13e5

Browse files
committed
minor wording improvements made to Inout Functions
1 parent fee19b5 commit 58d13e5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

spec/function.dd

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,10 @@ $(H2 $(LNAME2 auto-ref-functions, Auto Ref Functions))
423423

424424
$(H2 $(LNAME2 inout-functions, Inout Functions))
425425

426-
$(P Functions that deal with mutable, const, or immutable types with
427-
equanimity often need to transmit their type to the return value:)
428-
426+
$(P Functions that differ only in whether the parameters are mutable, const or immutable
427+
and have corresponding mutable, const or immutable return types can be combined
428+
into one function with the $(D inout) type constructor.
429+
)
429430
$(SPEC_RUNNABLE_EXAMPLE_COMPILE
430431
---
431432
int[] f1(int[] a, int x, int y) { return a[x .. y]; }
@@ -437,7 +438,7 @@ $(H2 $(LNAME2 inout-functions, Inout Functions))
437438
)
438439

439440
$(P The code generated by these three functions is identical.
440-
To indicate that these can be one function, the $(D_KEYWORD inout)
441+
To combine into one function, the $(D_KEYWORD inout)
441442
type constructor is employed:)
442443

443444
$(SPEC_RUNNABLE_EXAMPLE_COMPILE
@@ -524,7 +525,7 @@ $(H2 $(LNAME2 inout-functions, Inout Functions))
524525
---
525526
)
526527

527-
$(P $(B Note:) Shared types are not overlooked. Shared types cannot
528+
$(P $(B Note:) Shared types cannot
528529
be matched with inout.
529530
)
530531

0 commit comments

Comments
 (0)