What about putting array.empty in object.d?

Steven Schveighoffer schveiguy at yahoo.com
Wed Mar 21 17:17:06 PDT 2012


On Wed, 21 Mar 2012 19:56:41 -0400, Jonathan M Davis <jmdavisProg at gmx.com>  
wrote:


> Except that containers shouldn't provide indexing if it's not efficient.  
> And
> from what I've seen, it's far too common for programmers to check length  
> == 0,
> and they end up doing it on stuff like linked lists where it _is_  
> inefficient.

Wait, if someone provides inefficient length, what makes you think they  
won't provide inefficient indexing?

-Steve


More information about the Digitalmars-d mailing list