Conquering C++20 Ranges
summary
C++20 Ranges get concrete: author builds a reusable fibonacci view (infinite subrange from an iterator), implements a custom drop_last_while view that caches the computed end to make end amortized-constant, and writes a simple chain view so rotate can operate across two containers without copying into a big temporary. Code compiles with gcc11 (concept static_asserts show missing pieces), adapters work but need viewable/bi‑directional constraints, third‑party pipe syntax is not yet portable, and some iterator/view boilerplate is required.
AI-written summary · about
chapters (31)
- 0:00Intro
- 1:05Background
- 1:40Introduction
- 3:18Agenda
- 4:21Topics
- 5:06Fun
- 5:18Problem Statement
- 5:49Fibonacci Sequence
- 6:39fibfun
- 13:44Static assert
- 15:33Updating iterators
- 21:11Rewriting the Function
- 23:48String Trimming Revisited
- 27:16Class Template
- 28:55Member Variables
- 29:45Semantic Constraints
- 31:28Bidirectional Range
- 31:56Indirect Predicate
- 32:38BeginEnd Operations
- 34:47FindIfNot
- 35:44Temporary Views
- 36:43Semantic Retirement Requirements
- 38:44End Function
- 39:45Factory Function
- 41:47Drop Last While View
- 43:38P2387
- 48:40cyclic shift
- 51:44inherit from view
- 53:10Boilerplate
- 56:22Iterators
- 58:00Input Iterator
related talks
01h 04mEffective Ranges: A Tutorial for Using C++2x Ranges
01h 05mBetter C++ ranges
01h 00mMissing (and future?) C++ range concepts
01h 04mRange adaptors - 5 years after C++20
01h 01mIteration Revisited: A Safer Iteration Model for Cpp
01h 23mC++ Iteration Revisited 2024
01h 00mBack to Basics: (Range) Algorithms in C++
40mRanges and Iterators for Numerical Problems
