dkh.array

  • Declaration

    T[N] fixed(T, size_t N)(T[N] a);

    Make static array literal

    Examples

    1. auto a = [[1, 2].fixed]; assert(is(typeof(a) == int[2][]));

  • Declaration

    int[2] findFirst2D(T, U)(in T mp, in U c);

    Unstable

    Examples

    1. string[] mp = [ "s..", "...", "#g#"]; assert(mp.findFirst2D('s') == [0, 0]); assert(mp.findFirst2D('g') == [2, 1]);

  • Declaration

    ref auto at2D(T, U)(ref T mp, in U idx);

    Unstable

    Examples

    1. string[] mp = [ "s..", "...", "#g#"]; assert(mp.at2D([0, 0]) == 's'); assert(mp.at2D([2, 1]) == 'g');