"" gives an empty string, while "".idup gives null

simendsjo simendsjo at gmail.com
Wed Aug 3 03:35:08 PDT 2011


void main() {
     assert(is(typeof("") == typeof("".idup))); // both is immutable(char)[]

     assert(""      !is null);
     assert("".idup !is null); // fails - s is null. Why?
}


More information about the Digitalmars-d-learn mailing list