Skip to content

Commit ff82660

Browse files
jmh5309il
authored andcommitted
Change isSlice to packsOf where needed
1 parent f7061b4 commit ff82660

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

source/mir/ndslice/algorithm.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ template count(alias fun)
14701470
else
14711471
{
14721472
static if (isSlice!(Slices[0]))
1473-
enum flat = Slices.length == 1 && kindOf!(Slices[0]) == Contiguous && isSlice!(Slices[0]) != [1];
1473+
enum flat = Slices.length == 1 && kindOf!(Slices[0]) == Contiguous && packsOf!(Slices[0]) != [1];
14741474
else
14751475
enum flat = false;
14761476
static if (flat)

source/mir/ndslice/slice.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,7 +2118,7 @@ struct Slice(SliceKind kind, size_t[] packs, Iterator)
21182118
{
21192119
import mir.ndslice.topology : unpack;
21202120
auto sl = this[slices].unpack;
2121-
static assert(isSlice!(typeof(sl))[0] == concatenation.N);
2121+
static assert(packsOf!(typeof(sl))[0] == concatenation.N);
21222122
sl.opIndexOpAssignImplConcatenation!""(concatenation);
21232123
}
21242124

@@ -2437,7 +2437,7 @@ struct Slice(SliceKind kind, size_t[] packs, Iterator)
24372437
{
24382438
import mir.ndslice.topology : unpack;
24392439
auto sl = this[slices].unpack;
2440-
static assert(isSlice!(typeof(sl))[0] == concatenation.N);
2440+
static assert(packsOf!(typeof(sl))[0] == concatenation.N);
24412441
sl.opIndexOpAssignImplConcatenation!op(concatenation);
24422442
}
24432443

source/mir/ndslice/topology.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,10 +2475,10 @@ auto zip
24752475
(bool sameStrides = false, Slices...)(Slices slices)
24762476
if (Slices.length > 1 && allSatisfy!(isSlice, Slices))
24772477
{
2478-
enum packs = isSlice!(Slices[0]);
2478+
enum packs = packsOf!(Slices[0]);
24792479
foreach(i, S; Slices[1 .. $])
24802480
{
2481-
static assert(isSlice!S == packs, "zip: all Slices must have the same shape packs");
2481+
static assert(packsOf!S == packs, "zip: all Slices must have the same shape packs");
24822482
assert(slices[i + 1]._lengths == slices[0]._lengths, "zip: all slices must have the same lengths");
24832483
static if (sameStrides)
24842484
assert(slices[i + 1].unpack.strides == slices[0].unpack.strides, "zip: all slices must have the same strides when unpacked");

0 commit comments

Comments
 (0)