String to boolean inconsistency

Simen kjaeraas simen.kjaras at gmail.com
Sat Dec 11 19:00:37 PST 2010


Ellery Newcomer <ellery-newcomer at utulsa.edu> wrote:

> I forget, why are we supposed to use is instead of == with null?

'[] is null' compares ptr and length, while '[] == null' compares only
the length. Weirdly though, '[] is null' is false for ptr == 0,
length != 0. Not likely to happen much in practice.

-- 
Simen


More information about the Digitalmars-d mailing list