On Thu, Mar 15, 2012 at 03:34, Jos van Uden <user@domain.invalid> 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 > enum rank = 0; // Base case, ending the recursion. > } > > > TDPL never mentions the use of a comma operator inside an is > expression. Is this an undocumented feature? Also the symbol > 't' is never used, but if I remove it, it won't compile. > > It's a really good tutorial, but I find this particular example > puzzling.
Yes, the is() expression is puzzling in general. In fact, I rediscovered how quirky it was when writing the tutorial :) Nathan already gave you a link. I give it at the beginning of A.1, but I can see it's not really visible. I should change the link instruction to display the link as a footnote also.