if(arr) now a warning

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 30 04:46:08 PDT 2015


"Vladimir Panteleev"  wrote in message 
news:ajrysqkjmlqjlmkipboz at forum.dlang.org...

> On Wednesday, 29 April 2015 at 19:15:46 UTC, Jonathan M Davis
> wrote:
> > but std.allocator is definitely not your average code
>
> OK, I'm tired of hearing this argument.

It's valid though.  Most array code cares more about the contents than the 
address, while std.allocator only cares about the address.

> Here's the results against my ae library:
...
> I didn't examine every single one, but the first dozen are all
> false positives.

Yeah, looks like you're intentionally checking for null rather than empty. 
It sucks that so many places need updating.

> Oh, and note the few that occur in Phobos templates (with no
> instantiation trace). I'll have fun tracking those down!

Is that from string lambdas?  Does it give an instantiation trace when you 
use it with warning as errors? 



More information about the Digitalmars-d mailing list