Check if tuple contains value at compile time

Diggory diggsey at googlemail.com
Sat May 4 18:34:30 PDT 2013


On Sunday, 5 May 2013 at 00:33:34 UTC, bearophile wrote:
> Diggory:
>
>> It's not a TypeTuple, it's a tuple of strings.
>
> Then one simple way to do it is to convert it into an array of 
> strings, and then use canFind:
>
> [mytuple[]].canFind(needle)
>
> Bye,
> bearophile

OK, that makes sense but I'm not sure I understand that syntax.

The documentation seems too say that "[mytuple]" will make an 
array, or that "mytuple[]" will make a slice from a tuple 
(presumably with no arguments it will slice the entire tuple?), 
so how does "[mytuple[]]" work?


More information about the Digitalmars-d-learn mailing list