list<>.size()

Dima Volodin dvv@egcs.dvv.ru
Fri Mar 31 20:09:00 GMT 2000


It's in the STL FAQ at http://www.sgi.com/Technology/STL/FAQ.html
Look for "Why is list<>::size() linear time?"


On Fri, 31 Mar 2000 16:33:06 -0800, you wrote:

>Folks,
>
>Is list<>.size() O(1) for libstdc++ v3? I bring this up because it's
>becoming a portability problem for us--on Windows list<>.size is O(1),
>so developers will oftentimes write loops with repeated tests against
>it. This becomes a speed nightmare when we port these to Linux.
>
>If is not O(1) in libstdc++ v3, I would like to strongly encourage
>that it become so :).
>
>Regards,
>
>m.
>
>-- 
>Programmer             "Ha ha." "Ha ha." "What are you laughing at?"
>Loki Software                      "Just the horror of being alive."
> http://lokigames.com/~briareos/                   - Tony Millionaire
>



More information about the Gcc mailing list