[sword-devel] Offtopic: String.h or string

Patrick Narkinsky sword-devel@crosswire.org
Sat, 26 Feb 2000 12:38:25 -0500 (EST)


IIRC,

String (capital S) and String.h are associated with the string class used
by libg++, which is considered to be deprecated.  They are no longer being
developed or maintained and should not be used.

string.h and string are associated with the STL string class.  The
difference between string.h and string is that #include <string> enables
enables the use of the std namespace.  I would pretty strongly recommend
that all new development use string.  

WARNING: STL Strings in the current libstdc++ are NOT thread safe.  Use
with caution in multi-threaded programs.  To reiterate, this
non-thread-safeness is not just theoretical: they really will produce
bizaar results in MT programs.

You might want to consider using STLPort (www.stlport.org) instead of the
included libstdc++.  It is supposed to be thread safe, and is fully
standards conformant, unlike libstdc++.

Patrick

--
Patrick Narkinsky  				patrick@extremehope.org

'Specifics Doctor.  Labels do not make arguments.'  Spock, "I, Mudd"

On 26 Feb 2000, Torsten Uhlmann wrote:

> Hi C++ freaks,
> 
> I have an offtopic question: Which String class should I prefer to use in a
> project for my company, the one from String.h or string (as SWORD
> uses). What is the difference between those two, which one is better (if
> this can be said), which one is more common on different Unix
> plattforms.
> 
> Thanks for your suggestions.
> 
> -- 
> 
> best regards,
> Torsten Uhlmann
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> TUhlmann@gmx.de
> TUhlmann@debis.com
> 
> http://www.tuhlmann.purespace.de
> http://www.bibletime.de
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Wise men still seek him!
>