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:28:56 PDT 2016


On Thursday, 26 May 2016 at 15:25:26 UTC, ag0aep6g wrote:
> On 05/26/2016 04:03 PM, ArturG wrote:
>> for example:
>>
>> if(any floatingpoint.init) will be true
>> if(any char.init) also true
>> if("") also true
>>
>> while others are false e.g.
>>
>> string s;
>> if(s) will be false
>> all others are also false or did i miss any?
>
> What does it matter?

You would have to create special cases for them.


More information about the Digitalmars-d-learn mailing list