Institute for Advanced Professional Studies

C++ Standard Template Library

Workshop Overview:

This hands-on course covers in detail how to use the C++ Standard Template Library. It explains the key attributes of generic, component-based software development, and how the C++ Standard Template Library supports this approach. It covers all major features of the library, including its collection classes, algorithms, iterators, and function objects.

The course is case-study oriented, developing a variety of small, but useful programs using the C++ Standard Template Library, often showing the same program written in a variety of different ways. In addition, the course is extremely hands on: students are given a variety of assignments to develop programs using library features.

Course Objectives:

Upon successful completion of this course, participants will be able to:

  • Use STL collection classes and iterators to implement real-world data storage needs.
  • Use the key algorithms provided in the STL to quickly develop efficient solutions.
  • Extend the STL with their own generic collection classes and algorithms.

Topic Outline:

  • C++ Standard Template Library Features and Benefits
    • Why the STL is important
    • Primary uses
    • The key components of the STL
    • Current status

  • Iterators
    • Input and output iterators
    • Iterators and streams
    • Forward iterators
    • Bidirectional and random-access iterators
    • Iterators and pointers
    • Iterator adaptors
    • Insert, back, and front iterators

  • Container Basics
    • Commonalities among containers
    • Contained defined types
    • Iterator-creating operations
    • Copying and assigning containers

  • Sequence Containers
    • An overview of vectors
    • Vector constructors
    • Vectors and space allocation
    • Inserting and deleting elements
    • Vectors and iterators
    • Deques
    • How deques are implemented
    • Deques and iterators
    • Lists
    • List-specific operations

  • Sorted Associative Containers
    • Specifying element ordering
    • Sets
    • Inserting and deleting set elements
    • Multisets
    • Specialized set and multiset operations
    • Maps
    • Key-based access
    • Subscript-based access
    • Multimaps

  • Sequence Adaptors
    • Stacks
    • Queues
    • Priority Queues

  • Sequential Algorithms
    • Read-only operations
    • Counting algorithms
    • Locating elements and subsequences
    • Modifying algorithms
    • Placing values in sequences
    • Copying and replacing elements
    • Transforming collections
    • Removing algorithms

  • Order-Related Algorithms
    • Reversing and rotating algorithms
    • Random ordering and permutations
    • Sorting algorithms
    • Binary search
    • Set algorithms
    • Heap algorithms

  • Numeric Algorithms
    • Accumulation
    • Partial sums
    • Adjacent difference
    • Inner products
    • Minimums and maximums

  • Function Objects
    • Types of function objects
    • Comparison objects
    • Predicates
    • Function adaptors
    • Binders and negators

  • Tips
    • Simplifying STL's Use
    • Using STL efficiently in terms of time
    • Using STL efficiently in terms of space
    • Hiding STL's use
    • Extending STL

Course Duration:

3 days

Intended Audience:

Experienced C++ programmers who wish to become proficient at using the C++ Standard Template Library to more rapidly construct effective C++ applications.

Technical Prerequisites:

Participants should be experienced C++ programmers. They must be comfortable with all the major features of the language, including pointers, dynamic storage allocation, classes, abstract types, templates, and inheritance. They should know how to use standard facilities to edit, compile, and debug applications.

Course Format:

Hands-on lecture/workshop

© Copyright 1997-2015 Institute for Advanced Professional Studies (IAPS)