monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Re: using empty() instead of size()


From: Bruce Stephens
Subject: [Monotone-devel] Re: using empty() instead of size()
Date: Mon, 22 Sep 2008 23:04:27 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Markus Wanner <address@hidden> writes:

> Zack Weinberg wrote:
>> Sure, but C++98 requires size() to be O(1) for every container, so
>> there's really no excuse for a 4-15% performance difference.
>
> Hm.. I didn't know that, thanks.

Just because the standard says that doesn't mean that it's so in
implementations, of course.  For example size() in SGI's list may be
linear: <http://www.sgi.com/tech/stl/List.html>.

The standard uses odd terminology (I think, anyway).  There's a table
in 23.1 showing the operations and complexities, and some of the
complexities are "constant", and some are "(Note A)".  This is
explained below the table: "Those entries marked ‘‘(Note A)’’ should
have constant complexity."

I wonder if that's an RFC-style "should"?

I don't have a more recent standard---perhaps this has changed?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]