4 fail_compilation/fail12378.d(18): Error: undefined identifier `ANYTHING`
5 fail_compilation/fail12378.d(18): Error: undefined identifier `GOES`
6 fail_compilation/fail12378.d(91): instantiated from here: `MapResultS!((x0) => ANYTHING - GOES, Result)`
7 fail_compilation/fail12378.d(17): instantiated from here: `mapS!(Result)`
8 fail_compilation/fail12378.d(100): instantiated from here: `__lambda1!int`
9 fail_compilation/fail12378.d(91): instantiated from here: `MapResultS!((y0) => iota(2).mapS!((x0) => ANYTHING - GOES), Result)`
10 fail_compilation/fail12378.d(16): instantiated from here: `mapS!(Result)`
26 fail_compilation/fail12378.d(40): Error: undefined identifier `ANYTHING`
27 fail_compilation/fail12378.d(40): Error: undefined identifier `GOES`
28 fail_compilation/fail12378.d(112): instantiated from here: `MapResultC!((x0) => ANYTHING - GOES, Result)`
29 fail_compilation/fail12378.d(39): instantiated from here: `mapC!(Result)`
30 fail_compilation/fail12378.d(123): instantiated from here: `__lambda1!int`
31 fail_compilation/fail12378.d(112): instantiated from here: `MapResultC!((y0) => iota(2).mapC!((x0) => ANYTHING - GOES), Result)`
32 fail_compilation/fail12378.d(38): instantiated from here: `mapC!(Result)`
48 fail_compilation/fail12378.d(64): Error: undefined identifier `ANYTHING`
49 fail_compilation/fail12378.d(64): Error: undefined identifier `GOES`
50 fail_compilation/fail12378.d(135): instantiated from here: `MapResultI!((x0) => ANYTHING - GOES, Result)`
51 fail_compilation/fail12378.d(63): instantiated from here: `mapI!(Result)`
52 fail_compilation/fail12378.d(143): instantiated from here: `__lambda1!int`
53 fail_compilation/fail12378.d(135): instantiated from here: `MapResultI!((y0) => iota(2).mapI!((x0) => ANYTHING - GOES), Result)`
54 fail_compilation/fail12378.d(62): instantiated from here: `mapI!(Result)`
75 private Value current
, pastLast
;
77 @property inout(Value
) front() inout { return current
; }
80 return Result(0, end
);
87 alias AppliedReturnType(alias f
) = typeof(f(r
.front
));
88 static assert(!is(AppliedReturnType
!fun
== void),
89 "Mapping function must not return void.");
91 return MapResultS
!(fun
, R
)(r
);
94 struct MapResultS(alias fun
, R
)
98 @property auto ref front()
100 return fun(_input
.front
);
104 template mapC(fun
...)
108 alias AppliedReturnType(alias f
) = typeof(f(r
.front
));
109 static assert(!is(AppliedReturnType
!fun
== void),
110 "Mapping function must not return void.");
112 return new MapResultC
!(fun
, R
)(r
);
115 class MapResultC(alias fun
, R
)
119 this(R r
) { _input
= r
; }
121 @property auto ref front()
123 return fun(_input
.front
);
127 template mapI(fun
...)
131 alias AppliedReturnType(alias f
) = typeof(f(r
.front
));
132 static assert(!is(AppliedReturnType
!fun
== void),
133 "Mapping function must not return void.");
135 return MapResultI
!(fun
, R
).init
;
138 interface MapResultI(alias fun
, R
)
140 static @property auto ref front()
143 return fun(_input
.front
);