Meandering Through C++ Creating ranges::to
summary
Walks through a homemade ranges::to implementation that uses Concepts, if constexpr, and CRTP to pick between initialization/copy and in-place insertion; builds a range adapter type inheriting from range_adaptor_closure so the adapter can be a pipeline endpoint. Code compiles on GCC 13.2, 14.0 and Clang 18.1 under C++23, handles vectors and nested containers, solves copy issues for most containers with an emplace-based trick, but still needs special handling for sets, stacks and queues.
AI-written summary · about
chapters (8)
- 0:00Introduction and speaker background
- 7:58What is ranges::to and why it matters
- 17:53Solving the copy vs in-place dilemma
- 24:45Understanding ranges and sentinels
- 33:48Handling nested ranges and type deduction
- 37:04CRTP and range adapter implementation
- 42:07Testing pipelines with std::tuple
- 44:16Q&A and closing remarks
related talks
01h 36mImplementing Ranges and Views in C++
59mHow to Implement the C++ Standard Library (Part 2): An Excursion into libc++
01h 14mReintroduction to Generic Programming for C++ Engineers
38mWhat's New In C++23
01h 03mIteration Revisited: A Safer Iteration Model for C++
47mA Journey into Ranges, Views, Pipelines, and Currying
01h 00mBuilding and Extending the Iterator Hierarchy in a Modern, Multicore World
05m23 Ranges: slide & stride
