Skip to content

Commit

Permalink
Merge pull request #4300 from 9il/fbe
Browse files Browse the repository at this point in the history
Trivial Fix Issue 16010
  • Loading branch information
dnadlinger committed May 10, 2016
2 parents 411ff8e + 4c8980e commit 5e6c5d6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion std/experimental/ndslice/selection.d
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ auto byElement(size_t N, Range)(auto ref Slice!(N, Range) slice)
_indexes[i] = n;
n = _indexes[i - 1] + v;
}
assert(n < _slice._lengths[0]);
assert(n <= _slice._lengths[0]);
with (_slice)
{
_shift += (n - _indexes[0]) * _strides[0];
Expand Down Expand Up @@ -1381,6 +1381,14 @@ unittest
static assert(hasSlicing!B);
}

// Issue 16010
unittest
{
auto s = iotaSlice(3, 4).byElement;
foreach (_; 0 .. s.length)
s = s[1 .. $];
}

/++
Returns an forward range of all elements of standard simplex of a slice.
In case the slice has two dimensions, it is composed of elements of upper left triangular matrix.
Expand Down

0 comments on commit 5e6c5d6

Please sign in to comment.