Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b0d1e50

Browse files
committed
ditto
1 parent 406d116 commit b0d1e50

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

‎source/mir/ndslice/iterator.d‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,15 +1058,16 @@ struct MapIterator(Iterator, alias _fun)
10581058
return _fun(*_iterator);
10591059
}
10601060

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
10611068
auto ref opIndex(ptrdiff_t index) scope
10621069
{
1063-
static if (is(typeof(_iterator[0]) : Tuple!T, T...))
1064-
{
1065-
auto t = _iterator[index];
1066-
return _fun(autoExpandAndForward!t);
1067-
}
1068-
else
1069-
return _fun(_iterator[index]);
1070+
return _fun(_iterator[index]);
10701071
}
10711072

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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /