Skip to content
C++

Utilities & Strings

37 pages — optional, variant, expected, format, filesystem, chrono, string utilities, and more.

iostreams — Input/Output Streams

"C++ iostream system: standard streams, file and string streams, stream state, manipulators, custom operators, rdbuf redirection, and performance tuning."

C++98
Numeric Algorithms

"C++ numeric algorithms: accumulate, reduce, transform_reduce, prefix scans, inner_product, iota, gcd, lcm, midpoint, and lerp with parallel execution notes."

C++98
Random Number Generation

C++ <random> engines, distributions, seeding strategies, thread safety, and common pitfalls — from mt19937 to discrete_distribution.

C++11
std::any

Type-safe, type-erased container for a single value of any copy-constructible type, with runtime type queries and checked casts.

C++17
std::atomic

Thread-safe atomic operations without mutexes — memory orders, CAS loops, atomic_flag, atomic_ref (C++20), wait/notify (C++20), and lock-free patterns.

C++11
std::bitset

Fixed-size bit manipulation with set/reset/flip/test, bitwise operators, and integer/string conversions — stack-allocated, no heap, no UB from shift overflow.

C++98
std::chrono

Type-safe time and duration library — durations, clocks, time points, and C++20 calendar and timezone types.

C++11
std::chrono — Advanced Usage

Advanced C++ chrono covering C++20 calendar types, time zones, zoned_time, date arithmetic, DST edge cases, formatting, and clock selection.

C++20
std::expected

C++23 vocabulary type holding either a success value T or an error value E, making failure modes explicit in the return type without exceptions.

C++23
std::filesystem

Cross-platform filesystem operations in C++17 — path manipulation, directory traversal, file status queries, and file I/O utilities.

C++17
std::flat_map and std::flat_set (C++23)

C++23 sorted contiguous-memory container adapters with O(log n) binary search and cache-friendly layout — no pointer chasing through tree nodes.

C++23
std::format

Type-safe, compile-time-checked text formatting introduced in C++20, replacing printf and stream-based output with Python-style format strings.

C++20
std::format and std::print

C++20 std::format and C++23 std::print — type-safe formatted output with compile-time checking, custom formatters, and efficient direct printing.

C++20
std::from_chars / std::to_chars

C++17 charconv — locale-independent, non-allocating, non-throwing conversion between numbers and character buffers.

C++17
std::function

A general-purpose polymorphic function wrapper that type-erases any callable matching a given signature, at the cost of runtime overhead.

C++11
std::hash and Custom Hash Functions

std::hash specialization, hash_combine design, transparent heterogeneous lookup (C++20), and custom hash requirements for unordered containers.

C++11
std::inplace_vector (C++26)

Fixed-capacity vector with inline storage — dynamic size 0..N, no heap allocation, constexpr-compatible, and full std::vector-compatible API.

C++26
std::mdspan

Multi-dimensional non-owning view over contiguous data with pluggable layout and accessor policies. C++23 replacement for raw pointer and stride arithmetic.

C++23
std::optional

A value-or-nothing wrapper that eliminates sentinel values and nullable pointer workarounds in C++17.

C++17
std::optional Monadic Operations (C++23)

C++23 and_then, transform, and or_else on std::optional enable composable error-propagation pipelines without nested nullopt checks.

C++23
std::pair and std::tuple

std::pair and std::tuple store multiple values. Structured bindings, std::tie, std::apply, and composition patterns for heterogeneous data.

C++11
std::regex

C++ regular expressions — regex_match, regex_search, regex_replace, capture groups, iterators, and when to reach for a faster library.

C++11
std::scoped_allocator_adaptor

C++11 allocator adaptor that propagates one or more allocators through every nesting level of a container hierarchy via std::uses_allocator.

C++11
std::simd — Portable SIMD (C++26)

std::simd<T, Abi>: type-safe portable SIMD in C++26 (P1928) — write vectorized code once, compile to SSE/AVX/NEON/SVE automatically without intrinsics or platform ifdefs.

C++26
std::source_location (C++20)

Capture file, line, column, and function name at the call site without macros — the C++20 replacement for __FILE__ and __LINE__.

C++20
std::span

Non-owning view over a contiguous sequence of objects. C++20's type-safe replacement for (pointer, length) pairs, working with arrays, vectors, std::array, and raw buffers.

C++20
std::stacktrace (C++23)

Capture and inspect runtime call stacks with std::stacktrace — frame iteration, exception integration, allocator control, and compiler setup.

C++23
std::stop_token / stop_source (C++20)

"C++20 cooperative cancellation primitives: stop_token, stop_source, stop_callback, and jthread integration for safe thread shutdown."

C++20
std::string

"The C++ standard string class — mutable, owning character sequences with construction, modification, searching, and conversions. Zero-copy alternatives: std::string_view."

C++98
std::string_view

Non-owning view of a character sequence. Zero-copy alternative to const std::string&. Accepts literals, std::string, and char arrays without allocation.

C++17
std::string_view

"Non-owning, read-only string reference (C++17): zero-copy substrings, universal parameter type, constexpr usage, and lifetime hazards."

C++17
std::tuple and std::pair

Fixed-size heterogeneous collections with value semantics — pair for two values, tuple for N values of any types, with structured bindings support.

C++11
std::variant

Type-safe tagged union holding exactly one of a fixed set of alternative types, introduced in C++17 with no heap allocation.

C++17
String Algorithms

C++ string operations — searching, splitting, trimming, case conversion, replace-all, and fast number parsing with from_chars and string_view.

C++98
String Conversions

C++ string conversions — to_string, stoi/stof, from_chars, to_chars, and std::format with C++ version discipline and performance trade-offs.

C++11
String Conversions and std::locale

Fast, locale-independent parsing with from_chars/to_chars (C++17), convenient stoi/stod (C++11), and locale-aware formatting via std::locale and its facets.

C++11
Type Traits

"Compile-time type inspection and transformation via <type_traits>: primary categories, property queries, type modifications, and custom trait authoring."

C++11