Skip to content

Commit

Permalink
Add description to asserts.
Browse files Browse the repository at this point in the history
  • Loading branch information
9il committed Nov 18, 2015
1 parent 0df1a0a commit f91d611
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions std/experimental/range/ndslice.d
Original file line number Diff line number Diff line change
Expand Up @@ -927,9 +927,9 @@ auto byElement(size_t N, Range)(auto ref Slice!(N, Range) slice)
Tuple!(size_t, size_t) opSlice(size_t pos : 0)(size_t i, size_t j)
in {
assert(i <= j,
"opSlice!" ~ pos.stringof ~ ": left bound must be less then or equal right bound");
"ByElement.opSlice: left bound must be less then or equal right bound");
assert(j - i <= _length,
"opSlice!" ~ pos.stringof ~ ": difference between right and left bounds must be less then or equal length");
"ByElement.opSlice: difference between right and left bounds must be less then or equal length");
}
body {
return typeof(return)(i, j);
Expand Down Expand Up @@ -1704,7 +1704,10 @@ public:
Tuple!(size_t, size_t) opSlice(size_t dimension)(size_t i, size_t j)
if (dimension < N)
in {
assert(i <= j && j - i <= _lengths[dimension]);
assert(i <= j,
"Slice.opSlice!" ~ dimension.stringof ~ ": left bound must be less then or equal right bound");
assert(j - i <= _lengths[dimension],
"Slice.opSlice!" ~ dimension.stringof ~ ": difference between right and left bounds must be less then or equal length");
}
body {
return typeof(return)(i, j);
Expand Down

0 comments on commit f91d611

Please sign in to comment.