Skip to content
Module 5

STL & Algorithms

Master the Standard Template Library — containers, iterators, algorithms, ranges, and functional programming.

Containers

  1. Sequence Containers: vector, deque, list, array

    Explore the sequence containers in the STL — vector, deque, list, forward_list, and array. Learn their performance trade-offs, memory layouts, and iterator invalidation rules.

  2. Associative Containers: map, set, unordered_map

    Learn about ordered and unordered associative containers — maps, sets, and their multi- and unordered variants. Understand when to choose trees vs hash tables.

  3. Container Adaptors & Special Containers

    Learn about stack, queue, priority_queue, and modern vocabulary types like span, string_view, and optional. Understand when adaptors simplify your code.

Iterators & Algorithms

  1. Iterators: The STL Glue

    Understand iterator categories, from input iterators to contiguous iterators. Learn iterator arithmetic, the begin/end convention, and how iterators connect containers to algorithms.

  2. STL Algorithms: The Power of <algorithm>

    Master the most important STL algorithms — from searching and sorting to transforming and accumulating. Learn how algorithms compose with iterators for expressive, efficient code.

  3. Lambdas & Functional Programming

    Master C++ lambdas — capture lists, mutable lambdas, generic lambdas, and their use as algorithm predicates. Learn std::function, std::invoke, and the IIFE pattern.

Ranges & Views (C++20)

  1. C++20 Ranges: A New Paradigm

    Discover C++20 ranges — a modern redesign of the STL algorithm interface. Learn range concepts, range-based algorithms, projections, and the pipe operator for composable data transformations.

  2. Views, Lazy Evaluation & Composition

    Master C++20 views — lightweight, lazy range adaptors that compose with the pipe operator. Learn filter, transform, take, drop, split, join, iota, and how to build powerful data pipelines without intermediate allocations.