Why do some T.init evaluate to true while others to false?

arturg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 26 08:25:03 PDT 2016


On Thursday, 26 May 2016 at 15:15:57 UTC, Basile B. wrote:
> On Thursday, 26 May 2016 at 15:14:21 UTC, Basile B. wrote:
>> On Thursday, 26 May 2016 at 15:11:50 UTC, Basile B. wrote:
>>> On Thursday, 26 May 2016 at 14:03:16 UTC, ArturG wrote:
>>>> [...]
>>
>>> [...]
>>> - integral(*): if (i) <=> if (i > 0)
>>
>> I obviously meant:
>>
>> - integral(*): if (i) <=> if (i <> 0)
>>
>> and "<=>" stands for "equivalence"
>
> I obviously meant:
>
> integral(*): if (i) <=> if (i != 0),
>
> "<>" is the Pascal operator for C's "!=" ....

yes i know about most of those shortcuts its just float.init and 
char.init that work different then the other when you do this

if(someType) // will be true for float and char while someType is 
T.init



More information about the Digitalmars-d-learn mailing list