What about putting array.empty in object.d?
Jonathan M Davis
jmdavisProg at gmx.com
Wed Mar 21 21:26:34 PDT 2012
On Wednesday, March 21, 2012 21:12:36 Andrei Alexandrescu wrote:
> On 3/21/12 7:53 PM, Jonathan M Davis wrote:
> > Actually, it looks like std.container _does_ guarantee that length is
> > O(1), unlike C++'s STL, in which case it's not the same issue that it
> > is in C++.
> Here we learned from a small mistake of C++.
Yes. It looks that way. I'd forgotten that length had better guarantees in
D than in C++.
> (BTW it's O(log n).)
What's O(log n)? length in D? According to std.container, it's supposed to
be O(1).
- Jonathan M Davis
More information about the Digitalmars-d
mailing list