C++ Library recommendations ...

Roland Dreier roland at topspin.com
Wed Jan 29 02:27:18 EST 2003


    Felix> The thing the STL guy forgot is to keep in mind than
    Felix> 1000*linear (list insertions... ) is still worse than 1*exp
    Felix> (memcpy when doing vector insertions... but take this only
    Felix> as an example) when your list has, for example, 5 entries.

This isn't really on topic for the linuxppc list, but anyway...

What you say isn't really true.  The STL is generally quite efficient,
and provides both vector<> and list<> data structures (in addition to
slist<> and deque<>).

In fact, since a good implementation of vector<> will double the size
of its memory allocation each time it needs to grow it, the cost of
adding elements to the vector<> is still linear when amortized.

Best,
  Roland

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list