isSameSlices

Is true iff all Ts are slices with same unqualified matching element types.

Used to define template-restrictions on template parameters of only arrays (slices) of the same unqualified element types.

template isSameSlices (
Ts...
) if (
Ts.length >= 2
) {
enum isSameSlices;
enum isSameSlices;
enum isSameSlices;
}

Examples

1 static assert(isSameSlices!(int[], int[]));
2 static assert(isSameSlices!(const(int)[], int[]));
3 static assert(isSameSlices!(int[], const(int)[]));
4 static assert(isSameSlices!(int[], immutable(int)[]));
5 
6 static assert(isSameSlices!(int[], int[], int[]));
7 static assert(isSameSlices!(int[], const(int)[], int[]));
8 static assert(isSameSlices!(int[], const(int)[], immutable(int)[]));
9 static assert(isSameSlices!(const(int)[], const(int)[], const(int)[]));
10 
11 static assert(!isSameSlices!(int, char));
12 static assert(!isSameSlices!(int, const(char)));
13 static assert(!isSameSlices!(int, int));
14 
15 static assert(!isSameSlices!(int[], char[]));
16 static assert(!isSameSlices!(int[], char[], char[]));
17 static assert(!isSameSlices!(char[], int[]));
18 
19 static assert(!isSameSlices!(char[], dchar[]));
20 static assert(!isSameSlices!(wchar[], dchar[]));
21 static assert(!isSameSlices!(char[], wchar[]));

Meta