More operators inside `is(...)` expressions

Steven Schveighoffer schveiguy at gmail.com
Sun Aug 23 22:11:41 UTC 2020


On 8/23/20 5:52 PM, Dennis wrote:
> On Sunday, 23 August 2020 at 21:20:21 UTC, Steven Schveighoffer wrote:
>> What is the cost here? Just use the same AST node for the is 
>> expression, and wrap it in a `not` AST node.
> 
> What would `is(int != T, T)` mean? To me it sounds like T should be 
> bound to an arbitrary type that's not int, but when you lower it to 
> `!is(int == T, T)` it returns false.

I don't get this question at all.

What does that mean anyway? According to the grammar, the `, T` part is 
supposed to be template parameters.

And what is wrong with:

static if (is(int != T))
{
    // use T
}

-Steve


More information about the Digitalmars-d mailing list