Error with constraints on a templated fuction

Jeremy DeHaan via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Aug 25 09:10:21 PDT 2014


On Monday, 25 August 2014 at 15:52:20 UTC, bearophile wrote:
> Jeremy DeHaan:
>
>> It compiles if I remove the 'if(typeof(T) is dchar)' section. 
>> Any thoughts?
>
> Try:
>
> if (is(T == dchar))
>
> Bye,
> bearophile

That one compiles, and I'm assuming it works. I didn't know you 
could use is this way. I've only seen it as an 'obj1 is obj2' 
sort of way. Thanks much!


More information about the Digitalmars-d-learn mailing list