static struct S(size_t R, size_t C) { enum rows = R; enum cols = C; auto opIndex(size_t i, size_t j) const { return i + j; } alias at = opIndex; } static assert(isNarrowMatrix!(S!(0, 0))); static assert(isMatrix!(S!(1, 1)));
See Implementation