comma inside is expression

Nathan M. Swan nathanmswan at gmail.com
Wed Mar 14 20:05:18 PDT 2012


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.
>     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.
>
> Jos
It's documented on the language reference:
http://dlang.org/expression.html#IsExpression


More information about the Digitalmars-d-learn mailing list