Overview of STL

The C++ Standard Library is a set of core components of the language and are included and maintained in the C++ ISO Standard itself. The STL is an anlogous library, sharing similar functionalities with the former, without being neither a sub nor a super set.

What specifically characterizes the STL library is the focuse given on generic programming, as highlighted in the previous chapter (Why STL), but, even more important for the purpose of scientific computing, great care is taken to specify and keep the efficieny of the execution time high for every specific implementation of its components.

Let's begin with a bird's eye view of the content of STL.

The library covers four main topic areas:

  • Containers: a container is a holder object that stores a collection of other objects (its elements). Containers come in different flavor, depending on the kind of relationship required between members.
  • Iterators : An iterator is an object that, pointing to some element in a range of elements in a container, has the ability to iterate through the elements of that range using a set of operators (with at least the increment (++) and dereference (*) operators).
  • Algorithms: this is a very useful collection of operators designed to manipulate container objects according to various algorithms, like sorting, serching, removing or inserting elements in a collection.
  • Functors : A Function Object, or Functor (the two terms are synonymous) is simply any object that can be called as if it is a function. An ordinary function is a function object, and so is a function pointer; more generally, so is an object of a class that defines operator(). We'll see by examples what use these objects have in scientific computation.


This page belongs to the list of courses of HEP Software Foundation. Go back on the main page.