Introduction to the C++ Standard Template Library STL

This course is aimed at those who would like to learn their way around the Standard Template Library - STL. For this purpose, a good basic understanding of the C++ language is a prerequisite. The STL is a flexible and powerful library of general container implementations, container-related operations and algorithms. It even involves elements of functional programming. The STL has an extensible structure that allows to extend the layers in it, or to adapt foreign code. The aspect separation of its implementation has found use far beyond the STL and today it is one of the basic principles of modern library and framework implementations. Therefore, this seminar is not interesting only for the participants who want to use STL directly. It is also meaningful to those who understand these principles and want to integrate them in their own libraries.

In this course STL is presented by means of practical examples. In addition to the practice, the theory is presented, which deviates from traditional object-oriented programming. In addition to the layered structure of STL, the design principles of generic programming used stand in foreground. These principles are both important for the utilization of existing elements of STL and also for the design of personal library elements that have to cooperate with it. Of course the template programming in ANSI/ISO C++ is also generally addressed, since this is an indispensable prerequisite for the use of STL. Other important aspects are the runtime behavior and the footprint when using STL elements. For the application of the STL in special environments such as controller programming, the allocation behavior is also of central importance. These subjects are discussed in detail too.

The following subject matters are covered:

  • Differentiation: STL and C++ Standard Library
  • Generic Programming
  • The Aspect-oriented Approach
  • Functional Programming
  • The Template Programming in C++
  • Overview of the STL
  • Container
  • Adapter
  • Iterators
  • Algorithms
  • Lists
  • Vectors
  • Queues and Dequeues
  • Stacks
  • Sets and Multisets
  • Maps and Multimaps
  • The Runtime Behavior of Containers
  • The Allocation Behavior of Containers
  • Footprint
  • Compiler Support
  • Integration of the STL in the C++ Standard Library
  • The modifications of the new C++11 Standard
  • Iterator Design
  • Constant and Reverse Iterators
  • Forward, Bidirectional and Random-Access Iterators
  • Stream Iterators
  • Algorithms
  • Modifying and Non-modifying Algorithms
  • Function and Method Pointers
  • Parameter Binding
  • Function Objects
  • Generic Functors
  • Design Principles in the STL
  • Container Design
  • Personal Iterators
  • Algorithm Design
  • The Use of typename
  • The Meaning of typedef
  • The Aspect Separation in the Container Design
  • Allocators
  • The Aspect Separation in the Design of Algorithms
  • Codebloat and Code Optimization through Templates
  • The Application of Typetraits

Since practical examples are being performed in the course, a C++ compiler that is approximately ANSI/ISO compliant is required. Typically, a GNU C++ compiler, Clang or Visual C++ are used. The development platform - preferably Windows, Mac OS X, Linux or UNIX - should be well known to the course participants.

Last modified 10.07.2021