dumpArray

Dumps the provided array

  1. string dumpArray(size_t start, size_t end, size_t depth)
    template dumpArray(alias array)
    string
    dumpArray
    (
    size_t start
    ,
    size_t end
    ,
    size_t depth = 0
    )
    if (
    isArray!(typeof(array))
    )
  2. string dumpArray()

Members

Functions

dumpArray
string dumpArray(size_t start, size_t end, size_t depth)

Dumps the array within the provided boundries

dumpArray
string dumpArray()

Dumps the entire array

Parameters

array

the array to dump

Examples

Test dumping an array of integers

int[] test = [1,2,3];
writeln("Should have 3 things (BEGIN)");
write(dumpArray!(test));
writeln("Should have 3 things (END)");

Test dumping an array of integers with custom bounds

int[] test = [1,2,3];
writeln("Should have nothing (BEGIN)");
write(dumpArray!(test)(0, 0));
writeln("Should have nothing (END)");

Test dumping an array of integers with custom bounds

int[] test = [1,2,3];
writeln("Should have 2 (BEGIN)");
write(dumpArray!(test)(1, 2));
writeln("Should have 2 (END)");

Test dumping an array of integer arrays

int[][] test = [ [1,2,3], [4,5,6]];
write(dumpArray!(test));

Test dumping an array of an array of integer arrays

int[][][] test = [
    [   [1,2],
        [3,4]
    ],

    [
        [4,5],
        [6,7]
    ]
];
write(dumpArray!(test));

Tests out the compile-time component-type detection of string in any array of them

string[] stringArray = ["Hello", "world"];
writeln(dumpArray!(stringArray));

Tests the array-name dumping

int[] bruh = [1,2,3];
string g = dumpArray!(bruh)();
writeln(g);

Meta