@@ -423,9 +423,10 @@ $(H2 $(LNAME2 auto-ref-functions, Auto Ref Functions))
423
423
424
424
$(H2 $(LNAME2 inout-functions, Inout Functions))
425
425
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
+ )
429
430
$(SPEC_RUNNABLE_EXAMPLE_COMPILE
430
431
---
431
432
int[] f1(int[] a, int x, int y) { return a[x .. y]; }
@@ -437,7 +438,7 @@ $(H2 $(LNAME2 inout-functions, Inout Functions))
437
438
)
438
439
439
440
$(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)
441
442
type constructor is employed:)
442
443
443
444
$(SPEC_RUNNABLE_EXAMPLE_COMPILE
@@ -524,7 +525,7 @@ $(H2 $(LNAME2 inout-functions, Inout Functions))
524
525
---
525
526
)
526
527
527
- $(P $(B Note:) Shared types are not overlooked. Shared types cannot
528
+ $(P $(B Note:) Shared types cannot
528
529
be matched with inout.
529
530
)
530
531
0 commit comments