Standard Template Library


Using STLport

Borland C++Builder 6 includes the STLport 4.5 implementation of the C++ Standard Template Library. STLport is a free, open source project that is supported by numerous compilers and platforms. The STLport project uses a BSD-style license; it does not use the GPL. More information on the STLport project can be found at the STLport web site (http://www.stlport.com/). More information on the STLport license can be found at http://www.stlport.com/doc/license.html.

Rogue Wave implementation included for backward compatibility

C++Builder also retains the Rogue Wave C++ Standard Template Library for backward compatibility. However, STLport is C++Builder's default STL implementation. If you need to build a project using the Rogue Wave library, you must define the macro _USE_OLD_RW_STL, either at the command line (with the -D compiler option), or on the Directories and Conditionals page of the Project Options dialog box.

Using the debug version of STLport

In addition, you can define the symbol _STLP_DEBUG to force C++Builder to build your project with the debug version of the STLport library. Doing so will cause degradation in performance, however, as the debug version contains range checking code, "safe iterators", and precondition checking on algorithms and container methods. More information on using STLport with debugging code can be found on the STLport website (www.stlport.com/doc/debug_mode.html).

List of included header files

The following table describes the hierarchy of the include directory, as it relates to the use of the Rogue Wave and STLport header files. The variable BCB is your local C++Builder installation directory.

Directory Purpose
$(BCB)\include Rogue Wave header files formerly located in this directory, have been moved to ($BCB)\include\oldstl. The header files in the include directory are now wrappers, which will include either the STLport headers, or the Rogue Wave headers, depending on the macro _USE_OLD_RW_STL. The default action is to use the STLport headers (i.e. _USE_OLD_RW_STL is not defined)
$(BCB)\include\config Contains headers used to configure STLport for various build environments. C++Builder uses the file called stl_bc.h for this purpose. You should never edit the contents of this file.
$(BCB)\oldstl Contains the Rogue Wave header files.
$(BCB)\include\stlport Contains top-level header files that wrap internal STLport header files.
$(BCB)\include\stl Contains the internal STLport header files, which are wrapped by the top-level files in the stlport directory. This directory contains the header files that actually define the classes and functions in the STLport library.
$(BCB)\include\using Contains header files used internally by STLport to bring names into the STLport namespace.

The information in this table is provided to help you understand how STLport is currently integrated into C++Builder. You should never put an absolute path to the subdirectories of $(BCB)\include in your code, nor should you add these directories to the Include file path in the Directories and Conditionals page of the Project Options dialog box. These mechanisms were put into place so that switching between the Rogue Wave and STLport implementations would be a simple matter of defining a single macro.

The STLport library can be used in a number of different build configurations. The table below shows the libraries associated with each configuration:

Configuration Link Library Dynamic Link Library
Static, single-threaded stlp.lib N/A
Static, single-threaded, debugging enabled stlp_stldebug.lib N/A
Static, multi-threaded stlpmt.lib N/A
Static, multi-threaded, debugging enabled stlpmt_stldebug.lib N/A
Dynamic, single-threaded stlpi.lib stlp45.dll
Dynamic, single-threaded, debugging enabled stlp_stldebugi.lib stlp_stldebug45.dll
Dynamic, multi-threaded stlpmti.lib stlpmt45.dll
Dynamic, multi-threaded, debugging enabled stlpmt_stldebugi.lib stlpmt_stldebug.dll

C++Builder will automatically link your project with the appropriate library, based on your build settings. You do not need to add any of these libraries directly to your project. This is accomplished using the #pragma comment directive in the STLport configuration header files. You must be sure to distribute the appropriate dynamic link library when you deploy your application.

Using the STL with CORBA

C++Builder's CORBA wizards do not support the use of STLport. When you create a new CORBA project using any of the wizards on the Multitier tab of the New Items dialog box, the generated project will automatically have the _USE_OLD_RW_STL macro defined. Mixing libraries (i.e. C++Builder's Rogue Wave STL implementation, and legacy code that uses a different STL implementation) should not be a problem, as namespace issues will be resolved by C++Builder. However, you should never pass STL objects between a CORBA client and a CORBA server. This is not a limitation of C++Builder, but a general programming guideline. The STL defines only interfaces, not implementation, and there is a possibility of introducing marshalling errors when STL objects are passed between different implementations of the library.


HOME | TOP OF PAGE


Copyright (c) 2002 Borland Software Corporation. All rights reserved.

STLport copyright information:

Copyright © 1996-1999
Silicon Graphics Computer Systems, Inc.

Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Silicon Graphics makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.

Copyright © 1994
Hewlett-Packard Company

Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Hewlett-Packard Company makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.