Hello Saaa,

Is this a good way to get the depth of an array?

int getArrayDepth(T)(ref T array)
{
static if( is(T A:A[]) )
{
A arr;
return 1 + getArrayDepth(arr);
}
else
{
return 0;
}
return -1;
}

I just posted this today

http://www.dsource.org/projects/scrapple/browser/trunk/Serial/utill.d


Reply via email to