int
Signed integer;
fast, common for counters, indices, quantities.
uint
Non-negative integer;
useful for sizes, counts, bit manipulations.
float/double
used for prices, computations requiring decimals.
char
used in strings, parsing, small memory footprints.
bool
true/false flags, conditional states.
vector
Dynamic array; contiguous memory
Good for cache locality and fast iteration.
deque
Double-ended queue
slightly less cache-friendly than vector.
list
Doubly/singly linked list
Good for frequent insert/remove, but poor cache locality.
array
Fixed-size array; stack-allocated, no dynamic resizing.
Useful for small fixed-size buffers or embedded contexts.
string
Dynamic character sequence;
Widely used for identifiers, messages, parsing.
Associative Containers
set
Ordered unique elements;
good for fast lookup and sorted data.
map
Ordered key-value pairs;
good for dictionaries with sorted keys.
unordered_set
Hash-based unique elements;
useful for fast membership tests.
unordered_map
Hash-based key-value pairs;
good for fast lookups where ordering isn’t required.
stack
LIFO structure;
Useful for undo operations, recursion emulation.
queue
FIFO structure;
Good for task scheduling, event handling.
priority_queue
Heap-based max/min queue;
useful for event scheduling, order books, or top-K elements.
iterator
Object to traverse containers
sort
Sort container elements;
Useful for ordered output or binary search prep.
find
Linear search;
Simple element existence check.
binary_search
Logarithmic search on sorted data;
Fast membership check.
lower_bound / upper_bound
Binary search returning iterators;
useful for range queries in ordered containers.