string <-> null/bool implicit conversion

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 20 20:15:14 PDT 2015


On Thursday, 20 August 2015 at 20:43:39 UTC, Steven Schveighoffer 
wrote:
> This makes me think you misunderstand what I am doing.

If you care about whether an array is empty, you check whether 
its length is 0 or you call empty (which checks whether the 
length is 0). If you care about whether the array is null, you 
use "is null". I don't understand what else you could possibly be 
doing. "!= null" is just going to end up being equivalent to 
checking whether the length is 0, because the elements won't be 
compared if the length is 0, but it gives the false impression 
that you're checking whether the array is null - hence why 
checking != null is a bad idea. What am I missing here?

- Jonathan M Davis


More information about the Digitalmars-d mailing list