Unit 3: C++ Standard Template Library
every C++ programmer uses the C++ Standard Template Library (STL), a
powerful and highly useful library of generic-typed data structures and
algorithms. In this unit, we will learn how and why the STL was
originally developed. The unit will also introduce you to the history
and basics of templates and generic programming before presenting the
structures (Containers, Iterators, and Functors) and algorithms that the
Standard Template Library contains. By the end of this unit, you will
be familiar with the STL, its uses, and its structures and algorithms.
Completing this unit should take you approximately 7 hours.
3.1: History and Motivation
3.2: Main Design Ideas
3.3: The Elements of C++ STL
Software engineering implements general computation using four fundamental steps: requirements, design, code, and validation. In process terms, this becomes defining a problem or task, designing a solution, coding the solution, and testing the solution. C++ STL supports the transition from designing to coding. To exploit the similarity among problems and tasks, it is beneficial to reuse existing designs and code on new problems and tasks. The principle concepts of modularity, abstraction and composition support reusability. This article shows how programming languages implement these principles using data, expressions, functions, and control statements. Essentially C++ STL, and also Java Container Library, are a set of pre-tested trusted modules that implement standard data structures, containers, traversals, and data manipulations.
Unit 3 Assessment