null and initialized string comparisons

Martin martin.brzenska at googlemail.com
Wed Feb 17 20:48:22 UTC 2021


Hi,

is this how it supposed to be? (https://run.dlang.io/is/7B4irm)
---
string a = null;
string t = "";

assert( ! a );
assert( t );
assert( t == a );
---

I have not expected assert(t == a) to be true - i would like to 
know the argument for why this is correct when at the same time 
assert(!a) and assert(t) is true.. feels a litle bit js-ish to me


More information about the Digitalmars-d-learn mailing list