Skip to content

Commit 545dfd0

Browse files
committed
workaround for Issue 16473
1 parent a725dbc commit 545dfd0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

std/experimental/ndslice/slice.d

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2727,7 +2727,8 @@ struct Slice(size_t _N, _Range)
27272727
Increment `++` and Decrement `--` operators for a $(B fully defined index).
27282728
+/
27292729
auto ref opIndexUnary(string op)(size_t[N] _indexes...)
2730-
if (op == `++` || op == `--`)
2730+
// @@@workaround@@@ for Issue 16473
2731+
//if (op == `++` || op == `--`)
27312732
{
27322733
mixin (`return ` ~ op ~ `_ptr[indexStride(_indexes)];`);
27332734
}
@@ -2742,6 +2743,14 @@ struct Slice(size_t _N, _Range)
27422743
assert(a[1, 2] == 1);
27432744
}
27442745

2746+
// Issue 16473
2747+
static if (doUnittest)
2748+
unittest
2749+
{
2750+
auto sl = slice!double(2, 5);
2751+
auto d = -sl[0, 1];
2752+
}
2753+
27452754
static if (doUnittest)
27462755
pure nothrow unittest
27472756
{

0 commit comments

Comments
 (0)