Skip to content

Commit 075aea6

Browse files
authored
Use __traits(isStaticArray) instead of std.traits wrapper (#358)
1 parent 22918a5 commit 075aea6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

source/mir/appender.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private extern(C) @system nothrow @nogc pure void* memcpy(scope void* s1, scope
1616
struct ScopedBuffer(T, size_t bytes = 4096)
1717
if (bytes && T.sizeof <= bytes)
1818
{
19-
import std.traits: Unqual, isMutable, isStaticArray, isIterable, hasElaborateAssign, isAssignable, isArray;
19+
import std.traits: Unqual, isMutable, isIterable, hasElaborateAssign, isAssignable, isArray;
2020
import mir.primitives: hasLength;
2121
import mir.conv: emplaceRef;
2222

@@ -177,7 +177,7 @@ struct ScopedBuffer(T, size_t bytes = 4096)
177177

178178
///
179179
void put(Iterable)(Iterable range) scope
180-
if (isIterable!Iterable && !isStaticArray!Iterable && (!isArray!Iterable || hasElaborateAssign!T))
180+
if (isIterable!Iterable && !__traits(isStaticArray, Iterable) && (!isArray!Iterable || hasElaborateAssign!T))
181181
{
182182
static if (hasLength!Iterable)
183183
{

source/mir/array/allocation.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import std.traits;
3838
* allocated and initialized array
3939
*/
4040
auto array(Range)(Range r)
41-
if ((isInputRange!Range || isIterable!Range) && !isInfinite!Range && !isStaticArray!Range || isPointer!Range && (isInputRange!(PointerTarget!Range) || isIterable!(PointerTarget!Range)))
41+
if ((isInputRange!Range || isIterable!Range) && !isInfinite!Range && !__traits(isStaticArray, Range) || isPointer!Range && (isInputRange!(PointerTarget!Range) || isIterable!(PointerTarget!Range)))
4242
{
4343
static if (isIterable!Range)
4444
alias E = ForeachType!Range;
@@ -132,7 +132,7 @@ if ((isInputRange!Range || isIterable!Range) && !isInfinite!Range && !isStaticAr
132132
a.put(forward!e);
133133
}
134134

135-
return () @trusted {
135+
return () @trusted {
136136
auto ret = uninitializedArray!(Unqual!E[])(a.length);
137137
a.moveDataAndEmplaceTo(ret);
138138
return ret;

source/mir/ndslice/slice.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Returns:
239239
n-dimensional slice
240240
+/
241241
auto sliced(size_t N, Iterator)(Iterator iterator, size_t[N] lengths...)
242-
if (!isStaticArray!Iterator && N
242+
if (!__traits(isStaticArray, Iterator) && N
243243
&& !is(Iterator : Slice!(_Iterator, _N, kind), _Iterator, size_t _N, SliceKind kind))
244244
{
245245
alias C = ImplicitlyUnqual!(typeof(iterator));
@@ -2591,11 +2591,11 @@ public:
25912591
assert(imm == x);
25922592
assert(mut == x);
25932593
}
2594-
2594+
25952595
/++
25962596
Provides the index location of a slice, taking into account
25972597
`Slice._strides`. Similar to `Slice.indexStride`, except the slice is
2598-
indexed by a value. Called by `Slice.accessFlat`.
2598+
indexed by a value. Called by `Slice.accessFlat`.
25992599
26002600
Params:
26012601
n = location in slice
@@ -2632,7 +2632,7 @@ public:
26322632
}
26332633

26342634
/++
2635-
Provides access to a slice as if it were `flattened`.
2635+
Provides access to a slice as if it were `flattened`.
26362636
26372637
Params:
26382638
index = location in slice

0 commit comments

Comments
 (0)