Category

Standard Library Containers

Introduction to STL Containers

Learn what Standard Template Library (STL) containers are, how they eliminate manual memory management, and how to choose the right category of container for your data.

Jul 15, 2026 →

std::vector

Learn how to use std::vector in C++ to manage dynamically resizing arrays, understand the difference between size and capacity, and avoid iterator invalidation bugs.

Jul 15, 2026 →

Vector Size, Capacity, and Reallocation

Learn how std::vector manages memory behind the scenes, understand the performance costs of reallocation, and discover how to optimize capacity using shrink_to_fit.

Jul 15, 2026 →

std::deque

Learn how to use std::deque in C++ to manage double-ended queues, understand its segmented memory layout, and use its unique reference stability rules.

Jul 15, 2026 →

std::list and std::forward_list

Learn how to use std::list and std::forward_list in C++ to manage linked lists, understand their memory layout, and analyze their performance trade-offs.

Jul 15, 2026 →

std::set and std::unordered_set

Learn how to use std::set and std::unordered_set in C++ to store unique elements, understand their underlying tree and hash table mechanics, and perform fast lookups.

Jul 15, 2026 →

std::map and std::unordered_map

Learn how to use std::map and std::unordered_map in C++ to store key-value pairs, understand their performance differences, and safely look up elements.

Jul 15, 2026 →

std::stack, std::queue, and std::priority_queue

Learn how to use C++ container adaptors to manage LIFO, FIFO, and priority-sorted collections efficiently without exposing direct element access.

Jul 15, 2026 →

Choosing the Correct Container

Learn how to analyze your data access patterns, evaluate performance trade-offs, and choose the ideal C++ Standard Library container for your application.

Jul 15, 2026 →
About CppLearn

CppLearn is an interactive, free reference for modern C++. In each lesson, you'll find out how the language works, rather than just lines of code that you can copy and paste. We cover concepts starting from beginner lessons on fundamentals and proceed to templates, move semantics, smart pointers, and areas that usually trap or scare C++ learners.