On Thu, Mar 15, 2012 at 03:34, Jos van Uden wrote:
> I've been reading the tutorial on templates and found this example:
>
> template rank(T) {
> static if (is(T t == U[], U)) // is T an array of U, for some type U?
> enum rank = 1 + rank!(U); // then let’s recurse down.
> else
>
On Thursday, 15 March 2012 at 02:34:45 UTC, Jos van Uden wrote:
I've been reading the tutorial on templates and found this
example:
template rank(T) {
static if (is(T t == U[], U)) // is T an array of U, for
some type U?
enum rank = 1 + rank!(U); // then let’s recurse down.
e
I've been reading the tutorial on templates and found this example:
template rank(T) {
static if (is(T t == U[], U)) // is T an array of U, for some type U?
enum rank = 1 + rank!(U); // then let’s recurse down.
else
enum rank = 0; // Base case, ending the recursion.
}
T