On Sunday, 12 October 2014 at 16:21:50 UTC, bearophile wrote:
What happens if one of these conditions fails? Is an exception thrown? Note that you can also sort of do this using template constraints, but that of course only works at compile time:

double get2dimensional(int n, int m, int i, int j, double[] arr)()
if (n >= 0
    && m >= 0
    && 0 <= i
    && i < m
    && 0 <= j
    && j < n
    && arr.length == m * n)
{
    return arr[i * n + j];
}

Reply via email to