Thread (3 messages) 3 messages, 3 authors, 2003-01-28

Re: C++ Library recommendations ...

From: Roland Dreier <hidden>
Date: 2003-01-28 15:27:18

    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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help