On Mon, Sep 22, 2008 at 02:14:25PM -0700, Zack Weinberg wrote:
> I'm honestly surprised .empty() and .size() == 0 don't generate
> identical code, but hey.  Thanks!
  Imagine a linked list implementation. Finding out whether the
pointer to the first element is NULL is simple, and enough to answer
whether the list is empty. Finding out the number of elements requires
traversing the list.

  Of course you can implement a linked list differently, but that'd be
how a very simple implementation might behave. At least some STL list
implementations behave in a similar fashion.

Jens


_______________________________________________
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to