Skip to content

Commit 97efba1

Browse files
authored
Adding enums to avoid risk of GC allocation
Adding enums to avoid risk of GC allocation
1 parent 5b14ca7 commit 97efba1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

std/experimental/ndslice/selection.d

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ template pack(K...)
105105
auto a = r.sliced(3, 4, 5, 6);
106106
auto b = a.pack!2;
107107

108-
assert(b.shape == [3, 4]);
109-
assert(b[0, 0].shape == [5, 6]);
108+
enum res1 = [3, 4];
109+
enum res2 = [5, 6];
110+
assert(b.shape == res1);
111+
assert(b[0, 0].shape == res2);
110112
assert(a == b);
111113
static assert(is(typeof(b) == typeof(a.pack!2)));
112114
static assert(is(typeof(b) == Slice!(2, Slice!(3, typeof(r)))));

0 commit comments

Comments
 (0)