A Safer Iteration Model for C++
summary
Flux presents a C++20 library called Flux that replaces pointer-style iterators with index-like first/is_last/read_at/inc primitives, returning safe values (e.g. max returns an optional) and letting users implement sequences by specializing flux_sequence_traits. Contiguous C++20 ranges map automatically; noncontiguous ranges use flux::from_range. Runtime bounds-checked read_at is elided by modern compilers and an internal-iteration hook for_each_while enables vectorized code, so Flux often matches or outperforms standard ranges; read_at_unchecked is provided when measured hotspots require it.
AI-written summary · about
chapters (16)
- 0:00Intro
- 0:47STL Iteration
- 4:55What is Safety
- 5:52Undefined Behavior
- 19:15Iteration via Indices
- 20:34Iteration via Signed Indices
- 22:12Iteration via Min Indices
- 27:04Flux
- 28:52Iteration Operations
- 31:17Sequences
- 35:28Bounded sequences
- 38:21Algorithms
- 38:56Flux Pipelines
- 41:17Flux Pipeline Example
- 46:38Flux Sequence Adapters
- 53:27Implementation
related talks
59mFaster, Safer, Better Ranges
01h 01mAn Overview of Standard Ranges
01h 09mMissing (and future?) C++ Range Concepts
01h 02mC++20 Ranges in Practice
01h 13mFrom Iterators to Ranges — the Upcoming Evolution of the Standard Library
01h 34mAn Overview of Standard Ranges
01h 09mRe-Release: Missing (and future?) C++ Range Concepts
05mC++20 Ranges - The Stuff of Science Fiction
