Why type specialization is defined differently than is expression type specialization ?

Steven Schveighoffer schveiguy at yahoo.com
Wed Jun 27 13:27:39 PDT 2012


On Wed, 27 Jun 2012 16:16:53 -0400, Roman D. Boiko <rb at d-coding.com> wrote:

> On Wednesday, 27 June 2012 at 20:15:43 UTC, Roman D. Boiko wrote:
>> On Wednesday, 27 June 2012 at 17:13:10 UTC, Timon Gehr wrote:
>>> On 06/27/2012 03:56 PM, deadalnix wrote:
>>>> All is in the title.
>>>>
>>>> I can do is(T : class) but not template(T : class) . Is this intended  
>>>> or
>>>> is it because it is ?
>>>
>>> You cannot do is(T : class).
>>
>> Why? According to grammar,
>>
>> IsExpression:
>> is ( Type : TypeSpecialization )
>>
>> and

The condition is satisfied if Type is semantically correct and it is the  
same as or can be implicitly converted to TypeSpecialization.  
>>>TypeSpecialization is only allowed to be a Type.<<<

Emphasis added.

>>
>> TypeSpecialization:
>>
>> Type struct union class interface enum function delegate super const  
>> immutable inout shared return

This is only valid for is( Type == TypeSpecialization)

-Steve


More information about the Digitalmars-d mailing list