What's missing from Phobos for Orbit (package manager)

Steven Schveighoffer schveiguy at yahoo.com
Thu Feb 14 06:28:25 PST 2013


On Thu, 14 Feb 2013 06:58:12 -0500, Jacob Carlborg <doob at me.com> wrote:

> On 2013-02-14 10:46, Walter Bright wrote:
>
>> I don't understand why one would go around the horn to just check for
>> !empty.
>
> I've tried to explain, it shows what the intention is.
>
> Instead of "str.length == 0" I use "str.empty". Instead of "!str.empty"  
> I like to use "str.any".
>
> It's not a big deal but I would need to change quite a lot of code if  
> "str.any" isn't allowed.

Would this work?

bool any(R)(R r) if(isInputRange!R) { return !r.empty;}

-Steve


More information about the Digitalmars-d mailing list