Link to home
Start Free TrialLog in
Avatar of klopter
klopter

asked on

Is there a public domain template library that I can incorporate into my code?

Ideally this would be a subset of STL (perhaps with
the names changed systematically to avoid
name conflicts with STL) that I could include in  my
code so that I don't have to rely on STL implementations being consistent.

I am just looking for the basic stuff:  
   Linked lists, vectors, trees
 implemented cleanly and portably.

 Nothing fancy.
ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of klopter
klopter

ASKER

The upshot is that I want to start
using STL, but I just want to start
by dipping my big toe in.  


The code that I am working on does
not use STL.  Maybe that was the
right decision two years, maybe it
isn't now.  

If I start using STL and as a result
we have portability problems, I
will pay the price AND they will
never use STL again.

I am only interested in container
classes at this point.  Nothing
system specific.  

My thought was that if I could snag
a bit of a public domain STL and
use it, I could get that big toe
wet without risking bumping into
portability problems.

Ken
What compiler/OS are you using and what compiler/OS might you be porting to?  (To get an idea of what sort of problems you might expect).

If you stick to the "core" parts of STL and the less advanced features you are less likley to run into problems and it does sound like you are not goign to be a "power user" and get into the more remote things.  I really don't think you will find problems unless you are forced to use a very old compiler.

>> if I could snag
>> a bit of a public domain STL and
>> use it, I could get that big toe
>> wet without risking bumping into
>> portability problems.
Reasonable, but wrong.  The different versions of STL out there tend to be written to isolate you from differences among compilers.  That is they themselves are non-portable, but they are written so that code that uses them will be portable.  Does that  make sense?  For example, some compilers don't yet support template member functions (template functions that are class members).  The official STL classes use this feature.  So versions of STL that don't support template member functions are "crippled" so that the feature isn't required, plust they may contain additional code so that the missing feature is not usually missed.  Versions of STL that do support template member functions, do have the ful feature.  So the STL code itself will not be portable from a compiler that supports template member functions to a compiler that doesn't suppport them.  However code that uses the STL will be protable, unless it happens to use this feature in a way that the "patched" STL didn't anticipate.