Skip to content

Commit

Permalink
ditto
Browse files Browse the repository at this point in the history
  • Loading branch information
9il committed Dec 17, 2024
1 parent 406d116 commit b0d1e50
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions source/mir/ndslice/iterator.d
Original file line number Diff line number Diff line change
Expand Up @@ -1058,15 +1058,16 @@ struct MapIterator(Iterator, alias _fun)
return _fun(*_iterator);
}

static if (is(typeof(_iterator[0]) : Tuple!T, T...))
auto ref opIndex(ptrdiff_t index)
{
auto t = _iterator[index];
return _fun(autoExpandAndForward!t);
}
else
auto ref opIndex(ptrdiff_t index) scope
{
static if (is(typeof(_iterator[0]) : Tuple!T, T...))
{
auto t = _iterator[index];
return _fun(autoExpandAndForward!t);
}
else
return _fun(_iterator[index]);
return _fun(_iterator[index]);
}

static if (!__traits(compiles, &opIndex(ptrdiff_t.init)))
Expand Down

0 comments on commit b0d1e50

Please sign in to comment.