From bc7dbfedd5219088edecfa2cfd224a557d37331b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Nordl=C3=B6w?= Date: Thu, 16 Sep 2021 21:29:37 +0200 Subject: [PATCH] Use __traits(isStaticArray) instead of std.traits wrapper --- source/mir/appender.d | 4 ++-- source/mir/array/allocation.d | 4 ++-- source/mir/ndslice/slice.d | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/mir/appender.d b/source/mir/appender.d index 3c524357..7e6c0b72 100644 --- a/source/mir/appender.d +++ b/source/mir/appender.d @@ -16,7 +16,7 @@ private extern(C) @system nothrow @nogc pure void* memcpy(scope void* s1, scope struct ScopedBuffer(T, size_t bytes = 4096) if (bytes && T.sizeof <= bytes) { - import std.traits: Unqual, isMutable, isStaticArray, isIterable, hasElaborateAssign, isAssignable, isArray; + import std.traits: Unqual, isMutable, isIterable, hasElaborateAssign, isAssignable, isArray; import mir.primitives: hasLength; import mir.conv: emplaceRef; @@ -177,7 +177,7 @@ struct ScopedBuffer(T, size_t bytes = 4096) /// void put(Iterable)(Iterable range) scope - if (isIterable!Iterable && !isStaticArray!Iterable && (!isArray!Iterable || hasElaborateAssign!T)) + if (isIterable!Iterable && !__traits(isStaticArray, Iterable) && (!isArray!Iterable || hasElaborateAssign!T)) { static if (hasLength!Iterable) { diff --git a/source/mir/array/allocation.d b/source/mir/array/allocation.d index a2488f8e..40263aed 100644 --- a/source/mir/array/allocation.d +++ b/source/mir/array/allocation.d @@ -38,7 +38,7 @@ import std.traits; * allocated and initialized array */ auto array(Range)(Range r) -if ((isInputRange!Range || isIterable!Range) && !isInfinite!Range && !isStaticArray!Range || isPointer!Range && (isInputRange!(PointerTarget!Range) || isIterable!(PointerTarget!Range))) +if ((isInputRange!Range || isIterable!Range) && !isInfinite!Range && !__traits(isStaticArray, Range) || isPointer!Range && (isInputRange!(PointerTarget!Range) || isIterable!(PointerTarget!Range))) { static if (isIterable!Range) alias E = ForeachType!Range; @@ -132,7 +132,7 @@ if ((isInputRange!Range || isIterable!Range) && !isInfinite!Range && !isStaticAr a.put(forward!e); } - return () @trusted { + return () @trusted { auto ret = uninitializedArray!(Unqual!E[])(a.length); a.moveDataAndEmplaceTo(ret); return ret; diff --git a/source/mir/ndslice/slice.d b/source/mir/ndslice/slice.d index 6f769562..f9fb7d03 100644 --- a/source/mir/ndslice/slice.d +++ b/source/mir/ndslice/slice.d @@ -239,7 +239,7 @@ Returns: n-dimensional slice +/ auto sliced(size_t N, Iterator)(Iterator iterator, size_t[N] lengths...) - if (!isStaticArray!Iterator && N + if (!__traits(isStaticArray, Iterator) && N && !is(Iterator : Slice!(_Iterator, _N, kind), _Iterator, size_t _N, SliceKind kind)) { alias C = ImplicitlyUnqual!(typeof(iterator)); @@ -2591,11 +2591,11 @@ public: assert(imm == x); assert(mut == x); } - + /++ Provides the index location of a slice, taking into account `Slice._strides`. Similar to `Slice.indexStride`, except the slice is - indexed by a value. Called by `Slice.accessFlat`. + indexed by a value. Called by `Slice.accessFlat`. Params: n = location in slice @@ -2632,7 +2632,7 @@ public: } /++ - Provides access to a slice as if it were `flattened`. + Provides access to a slice as if it were `flattened`. Params: index = location in slice