On Mon, Sep 22, 2008 at 2:18 PM, Markus Wanner <[EMAIL PROTECTED]> wrote: >> I'm honestly surprised .empty() and .size() == 0 don't generate >> identical code, but hey. Thanks! > > For example for doubly linked lists, it's pretty simple to tell whether they > are empty or not, but counting the number of elements in the list requires > traversing the list.
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. zw _______________________________________________ Monotone-devel mailing list Monotone-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/monotone-devel