Re: STL slower than C
On 4 Nov., 12:16, Jeff Schwab wrote:
CornedBee wrote:
linked containers are one of the examples where non-
STL code (I'm not saying C code, because you can still benefit from
e.g. classes and templates in C++ without using the STL) can, in
theory, beat STL code, because the custom-written code can be
intrusive.
Intrusive to what? The value_type? How would that help? STL linked
lists don't allocate separate nodes and values; the values are members
of the nodes.
Yeah, but it creates a copy of it whereas Boost.Intrusive just alters
some pointers and leaves object life-time management to you. I
personally never felt the need to do that, though. Also, my guess is
that Boost.Intrusive will become less attractive in the light of C++0x
and "forwarded/delayed construction" (emplace_back, make_shared, etc)
Cheers,
SG
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]