if(arr) now a warning

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 10 08:57:11 PDT 2015


On 4/10/15 6:26 AM, Meta wrote:
> On Friday, 10 April 2015 at 12:42:47 UTC, Steven Schveighoffer wrote:
>> Plus, adding arr.empty into object is kind of redundant. The only
>> reason we have arr.empty is so that it becomes a range.
>>
>> -Steve
>
> I find it extremely annoying to have to import std.array (or whatever
> the correct module is) just to use .empty, .front and .popFront on
> arrays. IMO they should all be in object.d.

Yah, I was about to post the same. Range semantics are embedded in the 
language enough to warrant this.

Also empty should work for AAs.


Andrei


More information about the Digitalmars-d mailing list