@@ -745,7 +745,7 @@ $(GNAME OpApplyParameter):
745
745
Above, `opApply` is matched both when `i` is and is not `ref`, so by using
746
746
a `ref` delegate parameter, both forms are supported.
747
747
748
- Stating the type of the variable like in the first loop is optional,
748
+ Stating the type of the variable (as in the first loop) is optional,
749
749
as is showcased in the second loop, where the type is inferred.
750
750
)
751
751
@@ -770,10 +770,10 @@ $(GNAME OpApplyParameter):
770
770
771
771
$(P The $(D opApply) and $(D opApplyReverse) member functions can be overloaded.
772
772
Selection works similar to overload resolution by
773
- comparing the number of `foreach` variables and number of parameters of `body` and,
774
- if more than one overload remains unique overload ,
775
- matching the parameter types of `body` and each $(I ForeachType)
776
- declared in the $(I ForeachStatement) when given .)
773
+ comparing the number of `foreach` variables with the number of parameters of `body` and,
774
+ if more than one overload remains,
775
+ matching each parameter of `body` against each $(I ForeachType)
776
+ declared in the $(I ForeachStatement).)
777
777
778
778
$(BEST_PRACTICE Overload apply functions only with delegates differing in number of parameters
779
779
to enable type inference for `foreach` variables.
@@ -828,20 +828,20 @@ $(CONSOLE
828
828
829
829
$(PANEL
830
830
The `scope` storage class on the `body` parameter means that the delegate does
831
- not escape the scope of the apply function (an example would be assigning`body` to a
831
+ not escape the scope of the apply function (e.g. assigning `body` to a
832
832
global variable). If it cannot be statically guaranteed that `body` does not escape, a closure may
833
833
be allocated for it on the heap instead of the stack.
834
834
)
835
835
836
- $(P $(B Important:) If apply functions catch any exceptions, ensure that those
836
+ $(P $(B Important:) If an apply function catches any exceptions, ensure that those
837
837
exceptions did not originate from the delegate. The user would expect
838
838
exceptions thrown from a `foreach` body to both terminate the loop, and propagate outside
839
839
the `foreach` body.
840
840
)
841
841
842
842
$(H4 $(LNAME2 template-op-apply, Template `opApply`))
843
843
844
- $(P `opApply` and `opApplyReverse` can also be a function templates,
844
+ $(P `opApply` and `opApplyReverse` can also be function templates,
845
845
which can optionally infer the types of parameters based on the $(I ForeachStatement).
846
846
)
847
847
0 commit comments