poll for properties

Bill Baxter wbaxter at gmail.com
Tue Jul 28 16:34:23 PDT 2009


On Tue, Jul 28, 2009 at 4:16 PM, bearophile<bearophileHUGS at lycos.com> wrote:

> Another solution for D code (that I have used in my Set data structure. But it contains a negation):
> if (!b.length) {...}

The rationale for .empty is that .length could be an O(n) operation
for some containers, but .empty should always be O(1).  So, the
negation of  .length is not a general replacement for .empty.

--bb



More information about the Digitalmars-d mailing list