Standard Template Library - An Introduction
One of the later editions to the C++ standard is the StandardTemplate Library (STL). If you don't know what templates are, you might want to read the templatestutorial for an overview; although you don't need to know all theimplementation details, you will need to know how to use templates. The STL isa set of abstract datatypes, functions, and algorithms designed to handleuser-specified datatypes. Each of the abstract datatypes also contains theuseful functions to access them, this includes overloaded operators. Thespirit of the Standard Template Library is the idea of generic programming -the implementation of algorithms or datastructures without being dependent onthe type of data being handled.
The STL offers the programmer several advantages. First, themany predefined types simply program design; no longer does a programmer haveto write his own class to handle vectors, queues, or lists. Second, it offerspowerful type-independent algorithms, including the obvious sorting andsearching. Third, it does so at very lost cost to program performance, no morethan any other templated class or function.
Finally, though not part of the STL, the standard library includes astring class, which will be covered in this set of tutorials. For those of youwho have used the C string.h functions, it is a welcome relief to have accessto a simplified string manipulation interface. Not only strings, but vectors,linked lists, queues, stacks, as well as sorting, searching, numeric,permutation, and sequence operations are several of the datatypes and functionsincluded in the STL.
The scope of the STL is wide. Each tutorial in this series willcover one of the simplifying offerings of the library. The first few tutorialswill cover several basic datatypes, including strings, followed by more complexdatatypes, then followed with coverage of iterators and several templatedalgorithms. A comparison between the different datastructures will beincluded.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More Web Development Articles
More By Developer Shed