[Dev] STL

Ed Hill dev@trilug.org
05 Jan 2002 22:55:44 -0700


--=-UhIqTWy16Rf71TQgSlFd
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Sat, 2002-01-05 at 10:08, M. Mueller/bhu5nji wrote:
> Anyone out there using or used the C++ Standard Template Library?  I want=
 a=20
> dynamic list and the thought of writing another drove me to find STL.  I=20
> bought a book (STL Tutorial and Reference Guide, 2nd Ed. by Musser, Derge=
,=20
> and Saini) that seems well written.


Hi Mike,

I've used the STL a lot in the past (originally with the Rogue Wave STL
implementation on HP-UX and Suns and later with EGCS/GCC on Linux).=20
I've found that it can be *QUITE* painful to port STL code from one
compiler/library to another or even to a newer rev of the same
compiler/library.  The reason is that different template libraries are
of varying complexity (using more or less template features) and they
tend to *really* exercise the compiler.  So be careful!   Stuff that I
wrote that worked well with the old HP aC++ and EGCS releases is now
very broken with the RH 7.x gcc (gcc "2.96"), with the more recent 3.x
gcc versions, and with other C++ compilers.  And broken template code
just sucks to debug.

In terms of STL docs, I've used B. Stroustrup's text (excellent), the
Rogue Wave HTML docs that come with their implementation (ok), online
docs from the SGI STL implementation (ok), and some more esoteric refs
(eg. Barton & Nackman's "Scientific and Engineering C++").

If all you want are decent implementations of some data structures and
algorithms, then I strongly suggest that you look into something other
than the STL.  Take a good look at the C-based Glib

  http://developer.gnome.org/arch/gtk/glib.html

library which you can, of course, use within C++.  Its *very* portable.=20
And most of the data structures and algorithms that you're likely want
are in there...

hth,
Ed=20


--=20
Edward H. Hill III, PhD
Post-Doctoral Researcher   |  Email:       ed@eh3.com, ehill@mines.edu
Division of ESE            |  URL:         http://www.eh3.com
Colorado School of Mines   |  Phone:       303-273-3483
Golden, CO  80401          |  Fax:         303-273-3311
GnuPG Key ID:  1E76F123    |  Public key:  http://www.eh3.com/eh3.gpg

--=-UhIqTWy16Rf71TQgSlFd
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA8N+bgkytyZh528SMRAs6aAJ9G9F1sS3IBEHx4eaUDSWGQ8vRJbQCfSgc9
4AQv2IRO9GYg6UH35+2I2WE=
=mYQT
-----END PGP SIGNATURE-----

--=-UhIqTWy16Rf71TQgSlFd--