@@ -984,8 +984,8 @@ $(H4 $(LNAME2 front-seq, Multiple Element Values))
984
984
985
985
$(H3 $(LNAME2 foreach_over_delegates, Foreach over Delegates))
986
986
987
- $(P If $(I ForeachAggregate) is a delegate, the type signature of
988
- the delegate is of the same as for
987
+ $(P If $(I ForeachAggregate) is a delegate, the type signature and
988
+ behavior of the delegate is the same as for
989
989
$(RELATIVE_LINK2 foreach_over_struct_and_classes, opApply). This enables
990
990
many different named looping strategies to coexist in the same
991
991
class or struct.)
@@ -996,7 +996,7 @@ $(SPEC_RUNNABLE_EXAMPLE_RUN
996
996
--------------
997
997
// Custom loop implementation, that iterates over powers of 2 with
998
998
// alternating sign. The foreach loop body is passed in dg.
999
- int myLoop(int delegate(int) dg)
999
+ int myLoop(scope int delegate(int) dg)
1000
1000
{
1001
1001
for (int z = 1; z < 128; z *= -2)
1002
1002
{
@@ -1019,11 +1019,8 @@ $(SPEC_RUNNABLE_EXAMPLE_RUN
1019
1019
--------------
1020
1020
)
1021
1021
1022
- $(P $(B Note:) When $(I ForeachAggregate) is a delegate, the compiler
1023
- does not try to implement reverse traversal of the results returned by
1024
- the delegate when $(D foreach_reverse) is used. This may result in code
1025
- that is confusing to read. Therefore, using $(D foreach_reverse) with a
1026
- delegate is now deprecated, and will be rejected in the future.)
1022
+ $(P $(D foreach_reverse) with a delegate is an error.)
1023
+
1027
1024
1028
1025
$(H3 $(LNAME2 foreach_over_tuples, Foreach over Sequences))
1029
1026
0 commit comments