dimensionCount

Indicates the dimension count of an built-in array.

template dimensionCount (
T
) {
enum dimensionCount;
enum dimensionCount;
enum dimensionCount;
}

Parameters

T

type to be tested

Return Value

0 if T is an not a build-in array, otherwise a number at least equal to 1, according to the array dimension count.

Examples

1 static assert(dimensionCount!char == 0);
2 static assert(dimensionCount!(string[]) == 1);
3 static assert(dimensionCount!(int[]) == 1);
4 static assert(dimensionCount!(int[][]) == 2);
5 static assert(dimensionCount!(int[][][]) == 3);

Meta