The is expression

enuhtac enuhtac_lists at gmx.de
Sat Apr 2 03:54:05 PDT 2011


Am 02.04.2011 11:24, schrieb spir:
> On 04/02/2011 12:14 AM, enuhtac wrote:
>> template isA( T )
>> {
>>      static if( is( T U == A!( U, s ), string s ) )
>>          enum bool isA = true;
>>      else
>>          enum bool isA = false;
>> };
>
> What does ", string s" do here inside the is expression?
>
> Denis
A takes two template parameters: a type "T" and a value "string s". So I
need to specify both parameters in the is expression. In the D manual
you find something similar:

static if (is(int[10] W : W[V], int V))




More information about the Digitalmars-d-learn mailing list