STL (Standard Template Library) — collection of template classes and functions.
Components:
1. Containers:
vector — dynamic array.list — doubly linked list.deque — double-ended queue.array — fixed-size array.forward_list — singly linked list.set — sorted unique elements.map — sorted key-value pairs.unordered_set — hash set.unordered_map — hash map.stack, queue, priority_queue.2. Algorithms:
sort, find, binary_search.transform, accumulate.copy, fill, remove.3. Iterators:
4. Function objects (functors):
less, greater, plus, negate.Example:
1#include <vector>2#include <algorithm>34std::vector<int> v = {3, 1, 4, 1, 5};56// Sort7std::sort(v.begin(), v.end());89// Find10auto it = std::find(v.begin(), v.end(), 4);1112// Transform13std::transform(v.begin(), v.end(), v.begin(),14 [](int x) { return x * 2; });