On Tue, Jul 28, 2009 at 4:16 PM, bearophile<[email protected]> 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
