Smaller Source Code
There are approximately 50 different algorithms and about a dozen major data structures. This separation reduces the source code size, and decreases the risk of similar activities with dissimilar interfaces. In the absense of this separation, each algorithm must be implemented in each data structure. This requires additional member functions apart from those in the present scheme.
Flexibility
The algorithms that are separated from data structures can be used with conventional C++ pointers and arrays. Algorithms encapsulated within a class hierarchy do not have this ability because C++ arrays are not objects.
Efficiency
The STL in particular, and the Standard C++ Library in general, provide a
Iterators: Mismatches and Invalidations
The Standard C++ Library data structures use
Familiarity with the Standard C++ Library reduces the number of errors related to iterators.
Templates: Errors and Code Bloat
The flexibility and power of templatized algorithms is, with most compilers, results in a loss of precision in diagnostics. Errors in the parameter lists of generic algorithms is sometimes displayed only as obscure compiler errors for internal functions. These errors are defined many levels deep in template expansions. Familiarity with algorithms and their requirements is necessary to use the standard library. Heavy reliance on templates causes programs to grow larger than expected. You can minimize this problem by recognizing the cost of instantiating a particular template class, and by making appropriate design decisions. As compilers become more fluent in templates, the problem of size is reduced.
Multithreading Problems
When you use the Standard C++ Library in a multithreaded environment, the iterators cannot safely pass between threads. This is because iterators are independent of the containers they operate on. It is impossible to protect a container when it spawns iterators in multiple threads as iterators are used to modify a
Standard C++ Library Reference
The Standard C++ Library Reference provides an alphabetical listing of all of the classes, algorithms, and function objects in the prior Rogue Wave implementation of the Standard C++ Library.
Incompatibilities Between the Library and the Standard
The ANSI/ISO C++ International Standard is different from Standard C++ Library. For example, the times function object in the functional header file. In the standard, times is renamed to multiplies.
To use multiplies in your code and to be compatible with the ANSI/ISO C++ International Standard, use a conditional compilation flag on the aCC command line.
Example:
178 Tools and Libraries