Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2000-03-21
3
Medium Priority
?
201 Views
Last Modified: 2013-12-14
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.
0
Comment
Question by:klopter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 400 total points
ID: 2640781
>> names changed systematically to avoid
>> name conflicts with STL)
You can always use namespaces to prevent these problems.  The STL names are al in the "std" namespace.

>> so that I don't have to rely on STL
>> implementations being consistent.
Why woud this matter?  You should only care about the interface, not the implimentation.  

Sometimes the implimentation MUST be different.  For example streams must eventually contain OS-specific code to read and write from a file.

If you really have to do this, just copy the STL files from your compiler to a new name and modify them to use a different namespace.  Then just use these files.  But I really have to wonder if there is a good reason to do this.
0
 

Author Comment

by:klopter
ID: 2640855
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
0
 
LVL 22

Expert Comment

by:nietod
ID: 2641251
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.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question