[Dev] STL portability gotchas?

M. Mueller dev@trilug.org
Tue, 23 Apr 2002 13:59:37 -0400


On Tuesday 23 April 2002 01:30 pm, you wrote:
> Hi all,
>
> I was wondering if anyone knows of any STL portability issues. I am writing
> a small C++ application that I want to compile for Win32 (using Visual C++)
> as well as for Linux (using g++). I would love to use the list and map
> templates but I fear I would run into problems between the two platforms.
> Any pearls of wisdom would be appreciated.

I can't say from experience, but the Standard in STL probably means just 
that.  Now if your concern is that MS-STL may not be portable, then I you may 
have a justified concern.  Maybe they have MS-STL# for C#, .NET and ActiveX 
:-).  Look in the MS documentation for any enhancements and avoid those if 
they exist.  

I advocate using some of the examples from  Nicolai M Josuttis's *The C++ 
Standard Library, A Tutorial and Reference*, and compile and run them in both 
environments (open source and closed).  You can get them from the book's 
website. I'll bet they run just fine in both environments.

I'm stuffing everything into STL containers now.  They're a time saver and 
quality improver.  I am counting on them being portable between CPU 
architectures and OS.

-- 
Michael Mueller
Signalnetware, Inc.
www.signalnetware.com
919.621.6090