Is this a feature?
    Sebastiaan Koppe via Digitalmars-d-learn 
    digitalmars-d-learn at puremagic.com
       
    Thu Jan 21 07:14:40 PST 2016
    
    
  
On Thursday, 21 January 2016 at 14:39:43 UTC, Adam D. Ruppe wrote:
> On Thursday, 21 January 2016 at 14:35:09 UTC, Sebastiaan Koppe 
> wrote:
>> 	static if (!is(SomethingUndefined!moreUndefined[0] : 
>> UndefinedThing))
>
> Yes, the is expression returns false for undefined things 
> because they aren't types. The standard library uses this in a 
> lot of places to test for undefined functions, like checking 
> for features in ranges. (The is expression has been around a 
> lot longer than __traits btw)
Thanks. I reckoned as much. Can be handy in places. But I just 
spend some time figuring out that I was missing an import...
    
    
More information about the Digitalmars-d-learn
mailing list