We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 406d116 commit b0d1e50Copy full SHA for b0d1e50
source/mir/ndslice/iterator.d
@@ -1058,15 +1058,16 @@ struct MapIterator(Iterator, alias _fun)
1058
return _fun(*_iterator);
1059
}
1060
1061
+ static if (is(typeof(_iterator[0]) : Tuple!T, T...))
1062
+ auto ref opIndex(ptrdiff_t index)
1063
+ {
1064
+ auto t = _iterator[index];
1065
+ return _fun(autoExpandAndForward!t);
1066
+ }
1067
+ else
1068
auto ref opIndex(ptrdiff_t index) scope
1069
{
- static if (is(typeof(_iterator[0]) : Tuple!T, T...))
- {
- auto t = _iterator[index];
- return _fun(autoExpandAndForward!t);
- }
- else
- return _fun(_iterator[index]);
1070
+ return _fun(_iterator[index]);
1071
1072
1073
static if (!__traits(compiles, &opIndex(ptrdiff_t.init)))
0 commit comments